Skip to content

fix: commit header events atomically - #54

Open
mcollina wants to merge 1 commit into
ShogunPanda:mainfrom
mcollina:security/sec-07-atomic-header-events
Open

mcollina wants to merge 1 commit into
ShogunPanda:mainfrom
mcollina:security/sec-07-atomic-header-events

Conversation

@mcollina

Copy link
Copy Markdown
Contributor

Make header semantic updates atomic with their event batch.

Previously, special-header state such as Content-Length and Transfer-Encoding was committed before both active header events were known to fit. If the name event fit but the value event did not, parsing returned without consuming the header while retaining its semantic effects; retrying the same bytes then failed as a duplicate.

The parser now reserves capacity for all active name/value range events, plus the error and terminator reserve, before validating or mutating any header state.

Mirrored Rust and WASM regressions fill the event buffer to the exact partial-fit boundary, verify that no framing state is committed, then retry and successfully complete both Content-Length and chunked messages. The full Rust/fuzz and 99-test WASM suites pass, with focused non-SIMD coverage.

This fixes SEC-07 from #38.

This branch has not been deployed

No deployments
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