Skip to content

Commit 9af1306

Browse files
committed
PS: Accept test changes.
1 parent 7f9930e commit 9af1306

File tree

2 files changed

+1
-8
lines changed

2 files changed

+1
-8
lines changed

powershell/ql/test/query-tests/security/cwe-089/SqlInjection.expected

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,14 @@ edges
44
| test.ps1:1:1:1:10 | userinput | test.ps1:17:24:17:76 | SELECT * FROM MyTable WHERE MyColumn = '$userinput' | provenance | |
55
| test.ps1:1:1:1:10 | userinput | test.ps1:28:24:28:76 | SELECT * FROM MyTable WHERE MyColumn = '$userinput' | provenance | |
66
| test.ps1:1:1:1:10 | userinput | test.ps1:78:13:78:22 | userinput | provenance | |
7-
| test.ps1:1:1:1:10 | userinput | test.ps1:128:17:128:26 | userinput | provenance | |
87
| test.ps1:1:1:1:10 | userinput | test.ps1:128:28:128:37 | userinput | provenance | |
98
| test.ps1:1:14:1:45 | Call to read-host | test.ps1:1:1:1:10 | userinput | provenance | Src:MaD:0 |
109
| test.ps1:4:1:4:6 | query | test.ps1:5:72:5:77 | query | provenance | |
1110
| test.ps1:8:1:8:6 | query | test.ps1:9:72:9:77 | query | provenance | |
1211
| test.ps1:72:1:72:11 | QueryConn2 [element Query] | test.ps1:81:15:81:25 | QueryConn2 | provenance | |
1312
| test.ps1:72:15:79:1 | ${...} [element Query] | test.ps1:72:1:72:11 | QueryConn2 [element Query] | provenance | |
1413
| test.ps1:78:13:78:22 | userinput | test.ps1:72:15:79:1 | ${...} [element Query] | provenance | |
15-
| test.ps1:118:9:119:54 | validated | test.ps1:124:92:124:101 | validated | provenance | |
1614
| test.ps1:121:9:121:56 | unvalidated | test.ps1:125:92:125:103 | unvalidated | provenance | |
17-
| test.ps1:128:17:128:26 | userinput | test.ps1:118:9:119:54 | validated | provenance | |
1815
| test.ps1:128:28:128:37 | userinput | test.ps1:121:9:121:56 | unvalidated | provenance | |
1916
nodes
2017
| test.ps1:1:1:1:10 | userinput | semmle.label | userinput |
@@ -29,11 +26,8 @@ nodes
2926
| test.ps1:72:15:79:1 | ${...} [element Query] | semmle.label | ${...} [element Query] |
3027
| test.ps1:78:13:78:22 | userinput | semmle.label | userinput |
3128
| test.ps1:81:15:81:25 | QueryConn2 | semmle.label | QueryConn2 |
32-
| test.ps1:118:9:119:54 | validated | semmle.label | validated |
3329
| test.ps1:121:9:121:56 | unvalidated | semmle.label | unvalidated |
34-
| test.ps1:124:92:124:101 | validated | semmle.label | validated |
3530
| test.ps1:125:92:125:103 | unvalidated | semmle.label | unvalidated |
36-
| test.ps1:128:17:128:26 | userinput | semmle.label | userinput |
3731
| test.ps1:128:28:128:37 | userinput | semmle.label | userinput |
3832
subpaths
3933
#select
@@ -42,5 +36,4 @@ subpaths
4236
| test.ps1:17:24:17:76 | SELECT * FROM MyTable WHERE MyColumn = '$userinput' | test.ps1:1:14:1:45 | Call to read-host | test.ps1:17:24:17:76 | SELECT * FROM MyTable WHERE MyColumn = '$userinput' | This SQL query depends on a $@. | test.ps1:1:14:1:45 | Call to read-host | read from stdin |
4337
| test.ps1:28:24:28:76 | SELECT * FROM MyTable WHERE MyColumn = '$userinput' | test.ps1:1:14:1:45 | Call to read-host | test.ps1:28:24:28:76 | SELECT * FROM MyTable WHERE MyColumn = '$userinput' | This SQL query depends on a $@. | test.ps1:1:14:1:45 | Call to read-host | read from stdin |
4438
| test.ps1:81:15:81:25 | QueryConn2 | test.ps1:1:14:1:45 | Call to read-host | test.ps1:81:15:81:25 | QueryConn2 | This SQL query depends on a $@. | test.ps1:1:14:1:45 | Call to read-host | read from stdin |
45-
| test.ps1:124:92:124:101 | validated | test.ps1:1:14:1:45 | Call to read-host | test.ps1:124:92:124:101 | validated | This SQL query depends on a $@. | test.ps1:1:14:1:45 | Call to read-host | read from stdin |
4639
| test.ps1:125:92:125:103 | unvalidated | test.ps1:1:14:1:45 | Call to read-host | test.ps1:125:92:125:103 | unvalidated | This SQL query depends on a $@. | test.ps1:1:14:1:45 | Call to read-host | read from stdin |

powershell/ql/test/query-tests/security/cwe-089/test.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ function With-Validation() {
121121
[parameter(Mandatory=$true)][string]$unvalidated
122122
)
123123

124-
Invoke-Sqlcmd -unknown $userinput -ServerInstance "MyServer" -Database "MyDatabase" -q $validated # GOOD [FALSE POSITIVE]
124+
Invoke-Sqlcmd -unknown $userinput -ServerInstance "MyServer" -Database "MyDatabase" -q $validated # GOOD
125125
Invoke-Sqlcmd -unknown $userinput -ServerInstance "MyServer" -Database "MyDatabase" -q $unvalidated # BAD
126126
}
127127

0 commit comments

Comments
 (0)