Skip to content

serve: pass the box and depth limits to the reader (avkit v0.18.0) - #7

Merged
tannevaled merged 1 commit into
mainfrom
avkit-mp4-box-limits
Nov 14, 2026
Merged

tannevaled merged 1 commit into
mainfrom
avkit-mp4-box-limits

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

Refs go-avkit/avkit#89
Refs go-avkit/avkit#122

Second line of defence for MP4 boxes: go-avkit/avkit v0.18.0 bounds the boxes its reader walks.

  • go.mod: go-avkit/avkit v0.17.0 to v0.18.0.
  • open passes the request's clamped MaxBoxes and MaxDepth as ReaderLimits.MaxBoxes / MaxBoxDepth (a request can only lower them).
  • TestReaderRefusesMP4BoxFloodWithoutThePrescan: 20,000 boxes inside moov, pre-scan bypassed, refused as video.limit with a small allocation. On v0.17.0 it fails (no limit refusal, 2.7 MB allocated).
  • README Security section updated.

🤖 Generated with Claude Code

Bump go-avkit/avkit to v0.18.0 and give ReaderLimits the request's clamped
MaxBoxes and MaxDepth, so MP4 is bounded by the reader too. A test bypasses the
pre-scan with a box flood inside moov: video.limit, small allocation; on v0.17.0
it is not refused as a limit and allocates 2.7 MB.

Refs go-avkit/avkit#89

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@tannevaled
tannevaled merged commit 07925de into main Nov 14, 2026
8 checks passed
@tannevaled
tannevaled deleted the avkit-mp4-box-limits branch November 14, 2026 22:33
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