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 BER tag length check when length is between 0x80 and 0xFF #68

Closed
wants to merge 1 commit into from

Conversation

lqs
Copy link

@lqs lqs commented Feb 21, 2022

When a BER tag length is between 0x80 and 0xFF, it can only be encoded in two bytes and readObject reports a false ber2der: 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.

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.
@ctbmozilla-admin ctbmozilla-admin added the ARCHIVED CLOSED at time of archiving label Feb 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ARCHIVED CLOSED at time of archiving
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants