Skip to content

Reject truncated nested modules and components - #2724

Merged
alexcrichton merged 1 commit into
bytecodealliance:mainfrom
alexcrichton:fix-parse-nested-invalid
Oct 1, 2026
Merged

alexcrichton merged 1 commit into
bytecodealliance:mainfrom
alexcrichton:fix-parse-nested-invalid

Conversation

@alexcrichton

Copy link
Copy Markdown
Member

This fixes an issue where wasmparser accepted malformed components whose declared size for a nested component or module was larger than the actual component or module. The bug is in Parser where when it returns Payload::End it only checks to see that we're at eof, not that we're at eof at the expected position.

This fixes an issue where `wasmparser` accepted malformed components
whose declared size for a nested component or module was larger than the
actual component or module. The bug is in `Parser` where when it returns
`Payload::End` it only checks to see that we're at eof, not that we're
at eof at the expected position.
@alexcrichton
alexcrichton requested a review from a team as a code owner October 1, 2026 22:22
@alexcrichton
alexcrichton requested review from dicej and removed request for a team October 1, 2026 22:22
@alexcrichton
alexcrichton enabled auto-merge October 1, 2026 22:26
@alexcrichton
alexcrichton added this pull request to the merge queue Oct 1, 2026
Merged via the queue into bytecodealliance:main with commit d2d492d Oct 1, 2026
37 checks passed
@alexcrichton
alexcrichton deleted the fix-parse-nested-invalid branch October 1, 2026 22:39
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