Repository navigation
Commit 0754f5d
committed
fix(command-injection): judge option values by what the option does
Review of the first version: a constant prefix refuted the value of an
option that runs it (sh -c "echo $x", ssh -o ProxyCommand=..., find -exec),
and ssh operands after the host, a remote shell command, were read as plain
operands. A value an established option takes is now judged by what the
option does with it, whatever its prefix: run it (high), keep it as data
(git commit -m, gh --title: refuted), or an effect not established (medium);
after an option the model does not describe, the finding stays for review.
Operands a program runs as a command (ssh after the host, the program of
sudo, env, xargs, timeout..., arguments of a batch file) are high.
The option model also covers cmd /c and powershell -Command, shell flags
grouped with -c, tar -I, the program given by a constant executable=,
sys.executable, git.exe and python3.12; shell given at its position is
read; -- counts anywhere before the input, and ssh is no longer taken to
end its options there.
Refs #2081 parent 3a60f1e commit 0754f5d
3 files changed
Lines changed: 274 additions & 72 deletions
File tree
- docs
- src/coretrace_python/bundled/security/command_injection
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
118 | | - | |
| 118 | + | |
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
| |||
0 commit comments