Skip to content

fix: Harden additional JUMBF parser sites against integer underflow#2201

Merged
ak-singh merged 1 commit into
contentauth:mainfrom
ak-singh:ak-singh/jumbf-underflow
Jun 3, 2026
Merged

fix: Harden additional JUMBF parser sites against integer underflow#2201
ak-singh merged 1 commit into
contentauth:mainfrom
ak-singh:ak-singh/jumbf-underflow

Conversation

@ak-singh

@ak-singh ak-singh commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Vulnerability

Two additional sites in sdk/src/jumbf/boxes.rs compute size - HEADER_SIZE (or similar) on attacker-controlled size values without first validating the minimum size. Both follow the same underflow pattern addressed in #2200 but were not in the original report.

Sites

  • read_uuid_boxsize - HEADER_SIZE - 16 (UUID box's payload subtraction)
  • read_desc_box SaltHash private-box branch — header.size - HEADER_SIZE

Fix

Same checked_sub(...).ok_or(InvalidBoxHeader)? pattern as #2200

  • read_uuid_box: size.checked_sub(HEADER_SIZE + 16).ok_or(...)?
  • read_desc_box SaltHash branch: header.size.checked_sub(HEADER_SIZE).ok_or(...)?

Tests

Added 2 regression tests covering both sites.

Checklist

  • This PR represents a single feature, fix, or change.
  • All applicable changes have been documented.
  • Any TO DO items have been entered as GitHub issues and the link has been included in a comment.

@tmathern tmathern requested a review from gpeacock June 3, 2026 17:11
@ak-singh ak-singh force-pushed the ak-singh/jumbf-underflow branch from 5efbc08 to f0ee248 Compare June 3, 2026 19:07
@ak-singh ak-singh force-pushed the ak-singh/jumbf-underflow branch from f0ee248 to 2b2aed6 Compare June 3, 2026 22:27
@ak-singh ak-singh merged commit dd7760f into contentauth:main Jun 3, 2026
26 checks passed
This was referenced Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants