File tree Expand file tree Collapse file tree 3 files changed +20
-0
lines changed
powershell/ql/test/query-tests/security/cwe-078/CommandInjection Expand file tree Collapse file tree 3 files changed +20
-0
lines changed Original file line number Diff line number Diff line change 1+ edges
2+ | test.ps1:1:8:1:10 | x | test.ps1:3:28:3:48 | Get-Process -Id $x | provenance | |
3+ | test.ps1:5:10:5:21 | Env:MY_VAR | test.ps1:7:3:7:20 | $code --enabled | provenance | |
4+ nodes
5+ | test.ps1:1:8:1:10 | x | semmle.label | x |
6+ | test.ps1:3:28:3:48 | Get-Process -Id $x | semmle.label | Get-Process -Id $x |
7+ | test.ps1:5:10:5:21 | Env:MY_VAR | semmle.label | Env:MY_VAR |
8+ | test.ps1:7:3:7:20 | $code --enabled | semmle.label | $code --enabled |
9+ subpaths
10+ #select
11+ | test.ps1:3:28:3:48 | Get-Process -Id $x | test.ps1:1:8:1:10 | x | test.ps1:3:28:3:48 | Get-Process -Id $x | This command depends on a $@. | test.ps1:1:8:1:10 | x | user-provided value |
12+ | test.ps1:7:3:7:20 | $code --enabled | test.ps1:5:10:5:21 | Env:MY_VAR | test.ps1:7:3:7:20 | $code --enabled | This command depends on a $@. | test.ps1:5:10:5:21 | Env:MY_VAR | user-provided value |
Original file line number Diff line number Diff line change 1+ queries/security/cwe-078/CommandInjection.ql
Original file line number Diff line number Diff line change 1+ param ($x )
2+
3+ Invoke-Expression - Command " Get-Process -Id $x " # BAD
4+
5+ $code = " $Env: MY_VAR "
6+
7+ & " $code --enabled" # BAD
You can’t perform that action at this time.
0 commit comments