Skip to content

fix: guard parser stack bounds - #125

Draft
BridgeAR wants to merge 1 commit into
mainfrom
BridgeAR/2026-08-28-cjs-stack-bounds
Draft

fix: guard parser stack bounds#125
BridgeAR wants to merge 1 commit into
mainfrom
BridgeAR/2026-08-28-cjs-stack-bounds

Conversation

@BridgeAR

Copy link
Copy Markdown
Member

Wasm inputs nested beyond 2,048 entries wrote beyond the fixed parser stacks. Node could terminate instead of returning a parse error.

Fixes: #81

@guybedford

Copy link
Copy Markdown
Collaborator

Yeah we should land this one - were you able to get an idea of perf impact?

Wasm inputs nested beyond 2,048 entries wrote past fixed parser stacks, which could terminate Node instead of returning a parse error.

Fixes: #81
@BridgeAR
BridgeAR force-pushed the BridgeAR/2026-08-28-cjs-stack-bounds branch from 0f42d04 to 68a4cd3 Compare September 7, 2026 14:20
@BridgeAR

BridgeAR commented Sep 7, 2026

Copy link
Copy Markdown
Member Author

@guybedford the overhead was around ~0.15% in my benchmarks. This is generally a bit of a question, if we want to land this or not. Having source code like that is pretty much impossible, so it is only in case someone would try to parse code that is broken due to some point (if it would be malicious, the user would almost certainly be compromised without the parsing)

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.

Out of bounds memory access

2 participants