Repository navigation
fix(contrib): bound memory and run time of embedded interpreters - #873
Merged
Merged
Conversation
This was referenced Oct 20, 2026
Merged
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 verified
contrib/findings from the security and bug review of main at 83b31f1. Changes stay incontrib/plusSPEC.md.What changed
python (HIGH)
pythonDefaultMaxDuration. Before, it ran with no limit.$TTYonly selects the REPL when it names a live sandbox terminal (a char device for this execution). Soprintf 'while True: pass\n' | TTY=/dev/tty python3now runs stdin as a script.jq (HIGH): changes in the vendored gojq fork,
contrib/jq/internal/gojq/size.gojoin,tojson/tostringand@csv/@tsv/@share capped at 64 MiB.[range(n)]), concat,flatten,splitandexplodeare capped at 4Mi elements.exceeds size limiterror thattrycannot catch.repeat(.),def f: f; f).nodejs (HIGH, MEDIUM)
RangeError:repeat,padStart/padEnd,ArrayBuffer, typed arrays,Buffer.alloc/from/concatArray,Array.from,split,Array.prototypemethodsinstanceof, subclassing and inherited statics keep working. goja'sinstanceofrejects Proxy-wrapped constructors, so Proxies were not an option.fsoption reads go through anoptionValuehelper that maps missing keys toundefined.mkdirSync(p,{recursive:true}),rmSync(p,{force:true}),readFileSync(p,{}),readdirSync(d,{})and the others no longer panic the shell.mkdirSyncmodes keep only the 0o7777 bits (setuid/setgid/sticky are mapped properly), and negative, fractional or infinite modes are rejected.{mode: 134217728+493}no longer setsModeSymlink. A numeric second argument (mkdirSync(p, 0o750)) is now honored.awk, sqlite3 (LOW)
system(), so a slow upstream producer doesn't count. Exceeding it is exit 2.WITH RECURSIVE). Exceeding it is exit 1.codingtools
MaxImageBytes(5 MiB).Reviewer notes
Session.Interact, a shell pipe and the session's own terminal input both reach commands as the same virtual pipe type. Soprintf … | python3typed in an interactive session still opens the REPL, though it is now bounded and stops promptly on cancel. Fixing that fully needs the interp layer to mark pipeline pipes.TestNodeJSShebangViaEnvWorkswas already failing on main. It ran a 0644 script, and the runtime now enforces the exec bit. The test now runschmod +xfirst.Testing
python_limits_test.go,jq_limits_test.go, nodejslimits_test.go/modules_test.go,awk_limits_test.go,sqlite3_limits_test.go,toolset_test.go.go test ./...passes in contrib/python, jq, nodejs, awk, sqlite3 and codingtools.--allow-parallel-runnersbecause other sessions held the lint lock.