File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
powershell/ql/test/query-tests/security/cwe-078/CommandInjection Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 53
53
| test.ps1:170:36:170:41 | input | test.ps1:129:11:129:20 | userinput | provenance | |
54
54
| test.ps1:172:42:172:47 | input | test.ps1:136:11:136:20 | userinput | provenance | |
55
55
| test.ps1:173:42:173:47 | input | test.ps1:144:11:144:20 | userinput | provenance | |
56
+ | test.ps1:214:10:214:32 | Call to read-host | test.ps1:215:16:215:19 | $o | provenance | Src:MaD:0 |
56
57
nodes
57
58
| test.ps1:3:11:3:20 | userinput | semmle.label | userinput |
58
59
| test.ps1:4:23:4:52 | Get-Process -Name $UserInput | semmle.label | Get-Process -Name $UserInput |
@@ -109,6 +110,8 @@ nodes
109
110
| test.ps1:170:36:170:41 | input | semmle.label | input |
110
111
| test.ps1:172:42:172:47 | input | semmle.label | input |
111
112
| test.ps1:173:42:173:47 | input | semmle.label | input |
113
+ | test.ps1:214:10:214:32 | Call to read-host | semmle.label | Call to read-host |
114
+ | test.ps1:215:16:215:19 | $o | semmle.label | $o |
112
115
subpaths
113
116
#select
114
117
| test.ps1:4:23:4:52 | Get-Process -Name $UserInput | test.ps1:152:10:152:32 | Call to read-host | test.ps1:4:23:4:52 | Get-Process -Name $UserInput | This command depends on a $@. | test.ps1:152:10:152:32 | Call to read-host | user-provided value |
@@ -129,3 +132,4 @@ subpaths
129
132
| test.ps1:131:28:131:37 | UserInput | test.ps1:152:10:152:32 | Call to read-host | test.ps1:131:28:131:37 | UserInput | This command depends on a $@. | test.ps1:152:10:152:32 | Call to read-host | user-provided value |
130
133
| test.ps1:139:50:139:59 | UserInput | test.ps1:152:10:152:32 | Call to read-host | test.ps1:139:50:139:59 | UserInput | This command depends on a $@. | test.ps1:152:10:152:32 | Call to read-host | user-provided value |
131
134
| test.ps1:147:63:147:72 | UserInput | test.ps1:152:10:152:32 | Call to read-host | test.ps1:147:63:147:72 | UserInput | This command depends on a $@. | test.ps1:152:10:152:32 | Call to read-host | user-provided value |
135
+ | test.ps1:215:16:215:19 | $o | test.ps1:214:10:214:32 | Call to read-host | test.ps1:215:16:215:19 | $o | This command depends on a $@. | test.ps1:214:10:214:32 | Call to read-host | user-provided value |
Original file line number Diff line number Diff line change @@ -207,4 +207,10 @@ function Invoke-InvokeExpressionInjectionSafe4
207
207
Invoke-InvokeExpressionInjectionSafe1 - UserInput $input
208
208
Invoke-InvokeExpressionInjectionSafe2 - UserInput $input
209
209
Invoke-InvokeExpressionInjectionSafe3 - UserInput $input
210
- Invoke-InvokeExpressionInjectionSafe4 - UserInput $input
210
+ Invoke-InvokeExpressionInjectionSafe4 - UserInput $input
211
+
212
+ function false-positive-in-call-operator ($d )
213
+ {
214
+ $o = Read-Host " enter input"
215
+ & unzip - o " $o " - d $d # GOOD [FALSE POSITIVE]
216
+ }
You can’t perform that action at this time.
0 commit comments