Repository navigation
fix(contrib): bound nesting, sizes and REPL input across contrib modules - #891
Merged
Merged
Conversation
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.
Fixes the second contrib review findings:
monty.New(5,000 parens segfaulted the host); char-device stdin (/dev/zero) no longer starts the REPL; REPL lines capped at 1 MiB with a ctx check per read.system()gets a separate 5-minute allowance when the request has no deadline.gojq.MaxDepth(nested parens and long+/|/suffix chains);setpathchecksMaxArrayLengthbefore allocating;--streamstops past 8Mi emitted path elements.[1] | .[100000000] = 1).Array.prototype.join;JSON.stringifyruns with a guarding replacer (array replacers emulated);JSON.parse,eval,Functionand module/inline sources reject nesting over 10000. Note: wrappingevalmakes every eval call indirect.unlinkSync/rmdirSynccheck file type;stat().modeuses POSIX S_IF bits.Array(n).fillstays capped by the existing 16Mi receiver-length limit; a followingjoinis now bounded.SPEC.md updated in the contrib limits section. Regression tests added per fix;
go test ./...and lint pass in each touched module.