forked from fullsailor/pkcs7
-
Notifications
You must be signed in to change notification settings - Fork 92
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 BER tag length check when length is between 0x80 and 0xFF #68
Closed
Conversation
This file contains 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
This was referenced Jun 17, 2022
jentfoo
added a commit
to gravitational/pkcs7
that referenced
this pull request
Jul 21, 2023
This commit attempts to address possible `panic` conditions due to access outside of the bounds of the slice. There are specifically three changes: * A couple log messages are commented out due to them attempting to do an out of bounds view into the slice. * Existing protocol validation was fixed. There was an attempt to guard against these conditions, however in many cases there was an off by one error, or other conditions had not been considered. * A PR from the parent fork which attempts to bring in a protocol fix for lengths between `0x80` and `0xFF` was also included as part of this: mozilla-services#68 The logic for slice access has been reviewed carefully in an attempt to make sure we are defensive, but still allowing the nuance of the PKCS7 structure. In addition extensive fuzzing has been conducted on these changes.
jentfoo
added a commit
to gravitational/pkcs7
that referenced
this pull request
Jul 21, 2023
This commit attempts to address possible `panic` conditions due to access outside of the bounds of the slice. There are specifically three changes: * A couple log messages are commented out due to them attempting to do an out of bounds view into the slice. * Existing protocol validation was fixed. There was an attempt to guard against these conditions, however in many cases there was an off by one error, or other conditions had not been considered. * A PR from the parent fork which attempts to bring in a protocol fix for lengths between `0x80` and `0xFF` was also included as part of this: mozilla-services#68 The logic for slice access has been reviewed carefully in an attempt to make sure we are defensive, but still allowing the nuance of the PKCS7 structure. In addition extensive fuzzing has been conducted on these changes.
jentfoo
added a commit
to gravitational/pkcs7
that referenced
this pull request
Jul 24, 2023
This commit attempts to address possible `panic` conditions due to access outside of the bounds of the slice. There are specifically three changes: * A couple log messages are commented out due to them attempting to do an out of bounds view into the slice. * Existing protocol validation was fixed. There was an attempt to guard against these conditions, however in many cases there was an off by one error, or other conditions had not been considered. * A PR from the parent fork which attempts to bring in a protocol fix for lengths between `0x80` and `0xFF` was also included as part of this: mozilla-services#68 The logic for slice access has been reviewed carefully in an attempt to make sure we are defensive, but still allowing the nuance of the PKCS7 structure. In addition extensive fuzzing has been conducted on these changes.
jentfoo
added a commit
to gravitational/pkcs7
that referenced
this pull request
Aug 17, 2023
This commit attempts to address possible `panic` conditions due to access outside of the bounds of the slice. There are specifically three changes: * A couple log messages are commented out due to them attempting to do an out of bounds view into the slice. * Existing protocol validation was fixed. There was an attempt to guard against these conditions, however in many cases there was an off by one error, or other conditions had not been considered. * A PR from the parent fork which attempts to bring in a protocol fix for lengths between `0x80` and `0xFF` was also included as part of this: mozilla-services#68 The logic for slice access has been reviewed carefully in an attempt to make sure we are defensive, but still allowing the nuance of the PKCS7 structure. In addition extensive fuzzing has been conducted on these changes.
vanbroup
pushed a commit
to digitorus/pkcs7
that referenced
this pull request
Aug 18, 2023
This commit attempts to address possible `panic` conditions due to access outside of the bounds of the slice. There are specifically three changes: * A couple log messages are commented out due to them attempting to do an out of bounds view into the slice. * Existing protocol validation was fixed. There was an attempt to guard against these conditions, however in many cases there was an off by one error, or other conditions had not been considered. * A PR from the parent fork which attempts to bring in a protocol fix for lengths between `0x80` and `0xFF` was also included as part of this: mozilla-services#68 The logic for slice access has been reviewed carefully in an attempt to make sure we are defensive, but still allowing the nuance of the PKCS7 structure. In addition extensive fuzzing has been conducted on these changes.
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.
When a BER tag length is between 0x80 and 0xFF, it can only be encoded in two bytes and
readObject
reports a falseber2der: BER tag length has leading zero
error. This patch fixes the issue by checking the next byte and only report error when the leading zero can be really omitted.