Skip to content

Bound MP4 index table rewrites - #1894

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

Bound MP4 index table rewrites#1894
ddennedy merged 1 commit into
mltframework:masterfrom
acts-1631:security-fix-mp4-table-bounds

Conversation

@acts-1631

Copy link
Copy Markdown
Contributor

Shotcut can generate unbounded output and consume CPU when rewriting a crafted
MP4 containing an stco or co64 box with an oversized entry count.

Box::index_copy trusted the declared table count and rewrote entries without
checking the containing box. This patch validates the table header and bounds
the declared count against the available payload for both file-backed and
in-memory box contents.

Verification:

  • Malformed stco and co64 tables were rejected without unbounded output.
  • A valid one-entry stco table was rewritten successfully.

Validate stco and co64 entry counts against the containing box before rewriting either table. Apply the same check to in-memory box contents so malformed media cannot drive unbounded output or reads.
@ddennedy

Copy link
Copy Markdown
Member

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 4d1a34e into mltframework:master Aug 15, 2026
4 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