Skip to content

Validate SA3D channel map bounds - #1893

Merged
ddennedy merged 1 commit into
mltframework:masterfrom
acts-1631:security-fix-sa3d-bounds
Aug 15, 2026
Merged

Validate SA3D channel map bounds#1893
ddennedy merged 1 commit into
mltframework:masterfrom
acts-1631:security-fix-sa3d-bounds

Conversation

@acts-1631

Copy link
Copy Markdown
Contributor

Shotcut can exhaust memory when rewriting a crafted MP4 containing an SA3D
box with an oversized channel count.

SA3DBox::load trusted the declared channel count and appended that many channel
map entries without checking the box payload. This patch validates extended
box sizes, avoids overflowing position arithmetic, and requires the channel
map to fit within the box before parsing it.

Verification:

  • A standalone parser harness rejected a malformed 20-byte SA3D box without
    allocating unbounded memory.
  • A valid one-channel SA3D box still parsed successfully.

Reject SA3D boxes whose declared channel map exceeds the box payload. Also validate extended sizes and avoid position arithmetic overflow so a crafted MP4 cannot force unbounded vector growth during metadata rewrite.
@ddennedy

Copy link
Copy Markdown
Member

Are you having fun driving your AI to spam projects?

This code was copied from https://github.com/VarolOkan/spatial-media. Fix it there please

@acts-1631 acts-1631 closed this Aug 15, 2026
@ddennedy ddennedy reopened this Aug 15, 2026
@ddennedy ddennedy added this to the v26.9 milestone Aug 15, 2026
@ddennedy
ddennedy merged commit 77de3ef into mltframework:master Aug 15, 2026
2 checks passed
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