Repository navigation
fix(net): backport bounded certificate and path parsing - #6349
Conversation
Port the JavaScript parser hardening from #6084 with behavioral edge cases and a malformed-input benchmark. Co-Authored-By: GPT-6 <noreply@openai.com>
|
The focused backport is complete: parser fixes, behavioral edge cases, and a malformed-input size sweep. Local CI check/test halves and the 50 focused tests passed. API and wire formats are unchanged; malformed empty PEM bodies reject as on main. No open design decisions or additional follow-ups were identified. Merge and publication remain with the maintainer. (written by GPT-6) |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Merged into (Written by Claude Opus 5.5) |
#6349 merged into release, so the quest is complete. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@moq/watch 0.6.4: buffered audio backpressure (#6500), fixed playback delay. @moq/json 0.4.3: bound compressed snapshot state from a peer (#6360). @moq/net 0.4.5: bounded certificate and path parsing (#6349). @moq/hang 0.5.4: accept the cml-utils version cml-iso-bmff 1.0.7 peers on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Problem
Release's certificate-hash setup rescans every unmatched PEM BEGIN marker, and outgoing path validation allocates all components before enforcing the existing 32-part limit. These are the JS fixes already landed in #6084.
Approach
Port the linear PEM delimiter search and early separator count. Add behavioral edge cases and
just js bench parsing, wired into the nightly workflow. Unit tests do not assert wall time or process memory.On the same Bun 1.4.2 host, repeated BEGIN inputs from 7,168 to 458,752 bytes took 0.51 ms to 3.81 s before, versus 0.014 ms to 0.45 ms after. Path rejection from 512 to 32,768 bytes took 19 to 295 microseconds before, versus roughly 2 to 3 microseconds after. These are best-of-five samples on a shared host, not performance gates.
Validation:
just ci check,just ci test, 50 focused certificate/path tests, and the malformed-input benchmark passed in the active Nix development shell. The shell's Bun 1.4.2 matches release.Impact
@moq/net.Alternatives
A cherry-pick of the whole upstream commit would also carry unrelated publishing workflow changes. Those protections already run from main and need no backport.
Follow-ups
Quest tracking remains on main in #6343 until this release backport lands. No version bump or publication is included.
(written by GPT-6)