Skip to content

fix(flate): stop oversized release frames during inflation - #6961

Merged
kixelated merged 1 commit into
releasefrom
codex/backport-flate-budget
Oct 28, 2026
Merged

kixelated merged 1 commit into
releasefrom
codex/backport-flate-budget

Conversation

@kixelated

Copy link
Copy Markdown
Collaborator

Problem

The released @moq/flate decoder keeps inflating a hostile frame after its cap and returns small views that pin pako's scratch buffers.

Approach

Backport the bounded inflation and owned output fixes from moq-dev/moq#6900 onto release's per-frame decoder. Throw inside onData at the first chunk past the cap, refuse further input after that failure, clear retained chunks, and copy decoded frames into tight buffers.

Impact

  • Public API: unchanged, including maxFrameSize and its 64 MiB default.
  • Wire: unchanged.
  • No version bump, merge, publication, or release dispatch.

Validation

  • Reproduced both failures before the fix: a 1 MiB payload inflated completely with a 1 KiB cap, and retained output pinned a 64 KiB backing allocation.
  • All 12 codec tests pass, including bounded inflation, retained ownership, exact limits, and independent per-frame budgets.
  • just check origin/release passes, including JS checks, builds/API reports, tests, and documentation.
  • git diff --check passes.

Alternatives

Keep release's per-frame policy rather than bringing main's breaking group budget back.

Follow-ups

Tracked by moq-dev/moq#6955: merge and patch publication remain pending the maintainer's authorization.

(Written by GPT-6)

Co-Authored-By: GPT-6 <noreply@openai.com>
@kixelated
kixelated marked this pull request as ready for review October 28, 2026 00:10
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-28T00:11:28.044235Z 65fd28f Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@kixelated kixelated left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review by review (OpenAI)
Reviewed commit: 65fd28f

No actionable bugs found in this release-relative change. Throwing from onData stops inflation at the first over-budget chunk; the latched failure prevents reuse of partially advanced decoder state, and finally releases accumulated chunks. Tight output copies also cover empty frames without changing the wire format or release's independent per-frame budget.

Direction: this is a focused backport; preserving maxFrameSize rather than importing main's group-budget policy avoids an unnecessary compatibility change. The new regressions target bounded work, retained-buffer ownership, exact limits, and consecutive-frame budgets.

Verification: inspected the changed source/tests and release base. I did not run tests, builds, interop, or the reported reproductions; no merge or publication performed.

@kixelated

Copy link
Copy Markdown
Collaborator Author

Merge summary: backport of the bounded @moq/flate inflation and owned-output fixes from #6900 onto release, keeping release's per-frame maxFrameSize policy (no public API or wire change).

  • Head 65fd28fa50b43c7e82654ed07bd1425b7b9d5152: CI 19/19 passing, Codex review with no findings, OpenAI automated review with no actionable bugs.
  • quest check against origin/release passes.
  • No decisions outstanding. Landing with a merge commit per CONTRIBUTING for release; no version bump, publication, or release dispatch here (tracked by docs(quest): finish the flate release backport #6955).

(Written by Claude Opus 5.5)

@kixelated
kixelated merged commit f024a57 into release Oct 28, 2026
19 checks passed
@kixelated
kixelated deleted the codex/backport-flate-budget branch October 28, 2026 03:29
kixelated added a commit that referenced this pull request Oct 28, 2026
#6961 merged into release and @moq/flate 0.1.4 is on npm
with the bounded inflation and owned output.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kixelated added a commit to bgreenway/moq that referenced this pull request Oct 30, 2026
* chore(quest): claim quest/m0/backport-flate-budget.md

Quest-Claim: 63fc4c5676a40eb1

* docs(quest): track the flate release backport PR

* docs(quest): finish the flate release backport

moq-dev#6961 merged into release and @moq/flate 0.1.4 is on npm
with the bounded inflation and owned output.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: GPT-6 <noreply@openai.com>
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.

1 participant