fix: guard parser stack bounds - #125
Draft
BridgeAR wants to merge 1 commit into
Draft
Conversation
Collaborator
|
Yeah we should land this one - were you able to get an idea of perf impact? |
guybedford
approved these changes
Sep 7, 2026
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
force-pushed
the
BridgeAR/2026-08-28-cjs-stack-bounds
branch
from
September 7, 2026 14:20
0f42d04 to
68a4cd3
Compare
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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Wasm inputs nested beyond 2,048 entries wrote beyond the fixed parser stacks. Node could terminate instead of returning a parse error.
Fixes: #81