Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix various decoding issues. #74

Merged
merged 1 commit into from
Sep 13, 2023
Merged

Fix various decoding issues. #74

merged 1 commit into from
Sep 13, 2023

Conversation

partim
Copy link
Member

@partim partim commented Sep 13, 2023

This PR fixes a number of decoding issues. Specifically:

  • error out rather than panic when a nested value has a greater length than allowed by the outer value,
  • check that there is enough data available before skipping over a primitive value’s content,
  • checks that enough data is available before trying to parse a tag value,
  • checks for correct encoding of bit strings: don’t allow the number of unused bits to be greater than 7 and that they are zero for an empty bit string,
  • checks for correct encoding of object identifiers: they cannot be empty and the last byte must have bit 7 cleared.

The PR adds tests for these cases. It also adds a number of fuzzing targets to be used with cargo fuzz.

This PR provides the fixes for CVE-2023-39914.

@partim partim merged commit 4da91c3 into main Sep 13, 2023
12 checks passed
@partim partim deleted the decode-fixes branch September 13, 2023 09:12
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.

2 participants