Skip to content

Conversation

tomleavy
Copy link
Contributor

Description of changes:

This resolves two issues

  1. HashMap and BTreeMap MlsDecode implementation allows for duplicate keys to be discarded, which should throw an error instead
  2. HashMap and BTreeMap MlsDecode fails if presented with a specially crafted payload + zero length structure target for decode

Testing:

This file lacked proper tests, which have now been added

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT license.

@tomleavy tomleavy requested a review from a team as a code owner September 30, 2025 20:12
@codecov-commenter
Copy link

codecov-commenter commented Sep 30, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.82%. Comparing base (8b8b521) to head (15e0363).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #316      +/-   ##
==========================================
+ Coverage   88.70%   88.82%   +0.12%     
==========================================
  Files         182      182              
  Lines       29009    29174     +165     
==========================================
+ Hits        25732    25914     +182     
+ Misses       3277     3260      -17     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@stefunctional
Copy link
Contributor

The implementation for Vec<T> suffers from the same problem when T is zero-sized, leading to an infinite loop for a malicious payload pretending to have a non-empty Vec.

@stefunctional
Copy link
Contributor

It looks like git add mls-rs-codec/src/vec.rs might have been forgotten before the second commit.

mulmarta
mulmarta previously approved these changes Oct 13, 2025
mulmarta
mulmarta previously approved these changes Oct 13, 2025
@tomleavy tomleavy merged commit fde42ea into main Oct 15, 2025
34 checks passed
@tomleavy tomleavy deleted the codec-map-tests branch October 15, 2025 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants