You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
JS: Detect shell commands launched through env and nice - #23222
Command injection queries miss shell commands launched through env or nice, even though the shell still interprets the command string.
Recognize these launchers and common options while checking argument positions and avoiding stale array elements after mutations. The model does not yet handle env -S or dynamically assembled argument arrays.
Added regression coverage for all four affected queries, including non-shell operands and array mutations.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Unresolved launcher parsing, array mutation handling, and wrapper-call correlation defects cause false-positive and missed shell-command sinks, while overly broad recursive reachability risks poor performance on large databases.
Calls that mutate the array are not barriers: Object.assign(args, {0: "echo"}), or a helper that writes args[0], leaves the original shell element eligible even though env now runs echo. Account for mutations through known copying calls and resolved helpers before trusting initializer positions. The same gap exists in the wrapper walk at lines 257–263.
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
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.
Command injection queries miss shell commands launched through
envornice, even though the shell still interprets the command string.Recognize these launchers and common options while checking argument positions and avoiding stale array elements after mutations. The model does not yet handle
env -Sor dynamically assembled argument arrays.Added regression coverage for all four affected queries, including non-shell operands and array mutations.
Fixes #23220