Repository navigation
fix: harden decoding and encrypted writes (2.5.0) - #8
Merged
Merged
Conversation
- limit Vec<T> nesting and decoded memory per top-level Vec - keep CFB8 cipher and stream in sync when the writer fails - error instead of misframing when compression is unavailable - cap frame preallocation at 64 KiB - reject wide frame prefixes, below-threshold data_length, zlib trailing data - checked length casts for String and Vec - derive: allow W/R generics, parenthesize packet ID expressions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes from the library audit. API-compatible; adds
MAX_VEC_NESTINGandMAX_DECODED_VEC_BYTES.Vec<T>nesting to 128 and decoded memory to 32 MiB per top-levelVec(a recursive type could abort the process; an 8 KiB frame could allocate 264 MiB).compressionfeature, an active threshold now returns an error instead of misframing.data_lengthbelow the threshold, and trailing bytes after the zlib stream.StringandVec.W/Rgenerics compile; packet ID expressions are parenthesized.Behaviour changes: stricter decoding can reject input previously accepted, notably peers that compress below the negotiated threshold. Tests:
tests/hardening.rs.