Validate key material length when deserializing crypto tokens - #6552
Open
Alearner12 wants to merge 1 commit into
Open
Alearner12 wants to merge 1 commit into
Alearner12 wants to merge 1 commit into
Conversation
Signed-off-by: Alearner12 <siddharthtiwari155@yahoo.com>
This branch has not been deployed
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.
Description
KeyMaterialCDRDeserialize()readsdds.cryp.keymatfrom remote crypto tokens without checking the input size or the sequence lengths before copying into 32-byte arrays. Malformed input can read past the input or overwrite a key array.This change:
The original parser produced an AddressSanitizer stack-buffer-overflow when a length byte requested a 34-byte copy into a 32-byte key array; empty input also read out of bounds. With the fix, all 17 cryptography tests pass under AddressSanitizer. The full
fastddslibrary target builds, and the three changed files pass eProsima's uncrustify configuration.Fixes #6345
Potential backports for affected branches:
3.6.x,3.5.x, and2.14.x. Each still has the unchecked parser; maintainers can choose the supported targets.Contributor Checklist
versions.md.