Skip to content

Conversation

@MegaManSec
Copy link

HeaderProtection_apply and HeaderProtection_remove copied untrusted input into a fixed 1500-byte scratch buffer without verifying sizes, enabling heap OOB writes when header_len + payload_len (apply) or pn_offset + 4 (remove) exceeded the buffer. They also computed the header-protection sample without ensuring SAMPLE_LENGTH bytes were available, risking OOB reads.

  • apply: validate header_len >= pn_length, (header_len + payload_len) <= 1500, and payload_len >= (PACKET_NUMBER_LENGTH_MAX - pn_length) + SAMPLE_LENGTH.
  • remove: validate pn_offset within buffer bounds, input has at least pn_offset + PACKET_NUMBER_LENGTH_MAX bytes, and has SAMPLE_LENGTH following for the sample.

HeaderProtection_apply and HeaderProtection_remove copied untrusted input into a
fixed 1500-byte scratch buffer without verifying sizes, enabling heap OOB writes
when header_len + payload_len (apply) or pn_offset + 4 (remove) exceeded the
buffer. They also computed the header-protection sample without ensuring
SAMPLE_LENGTH bytes were available, risking OOB reads.

- apply: validate header_len >= pn_length, (header_len + payload_len) <= 1500,
  and payload_len >= (PACKET_NUMBER_LENGTH_MAX - pn_length) + SAMPLE_LENGTH.
- remove: validate pn_offset within buffer bounds, input has at least
  pn_offset + PACKET_NUMBER_LENGTH_MAX bytes, and has SAMPLE_LENGTH following
  for the sample.

Signed-off-by: Joshua Rogers <[email protected]>
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.

1 participant