Skip to content

Commit 1d64a79

Browse files
authored
Merge pull request #252 from microsoft/add-more-remote-flow-sources
PS: Add flow sources from `System.Net.WebClient`
2 parents d4571f5 + 766cf82 commit 1d64a79

File tree

8 files changed

+28
-24
lines changed

8 files changed

+28
-24
lines changed

powershell/ql/lib/semmle/code/powershell/frameworks/Microsoft.Win32.RegistryKey.model.yml

Lines changed: 0 additions & 8 deletions
This file was deleted.

powershell/ql/lib/semmle/code/powershell/frameworks/System.Management.Automation.Language.model.yml

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
extensions:
2+
- addsTo:
3+
pack: microsoft/powershell-all
4+
extensible: summaryModel
5+
data:
6+
- ["system.management.automation.language.codegeneration!", "Method[escapesinglequotedstringcontent]", "Argument[0]", "ReturnValue", "taint"]
7+
28
- addsTo:
39
pack: microsoft/powershell-all
410
extensible: sinkModel

powershell/ql/lib/semmle/code/powershell/frameworks/System.Net.Sockets.model.yml

Lines changed: 0 additions & 9 deletions
This file was deleted.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
extensions:
2+
- addsTo:
3+
pack: microsoft/powershell-all
4+
extensible: sourceModel
5+
data:
6+
- ["system.net.sockets.tcpclient", "Method[getstream].ReturnValue", "remote"]
7+
- ["system.net.sockets.udpclient", "Method[endreceive].ReturnValue", "remote"]
8+
- ["system.net.sockets.udpclient", "Method[receive].ReturnValue", "remote"]
9+
- ["system.net.sockets.udpclient", "Method[receiveasync].ReturnValue", "remote"]
10+
- ["system.net.webclient", "Method[downloaddata].ReturnValue", "remote"]
11+
- ["system.net.webclient", "Method[downloaddataasync].ReturnValue", "remote"]
12+
- ["system.net.webclient", "Method[downloaddatataskasync].ReturnValue", "remote"]
13+
- ["system.net.webclient", "Method[downloadfile].ReturnValue", "remote"]
14+
- ["system.net.webclient", "Method[downloadfileasync].ReturnValue", "remote"]
15+
- ["system.net.webclient", "Method[downloadfiletaskasync].ReturnValue", "remote"]
16+
- ["system.net.webclient", "Method[downloadstring].ReturnValue", "remote"]
17+
- ["system.net.webclient", "Method[downloadstringasync].ReturnValue", "remote"]
18+
- ["system.net.webclient", "Method[downloadstringtaskasync].ReturnValue", "remote"]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
| test.ps1:1:1:18:0 | [synth] pipeline | Unexpected result: type="command line argument" |
1+
| test.ps1:1:1:20:93 | [synth] pipeline | Unexpected result: type="command line argument" |

powershell/ql/test/library-tests/frameworks/system_net_sockets/test.ps1

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,6 @@ $remoteEndpoint2 = $null
1515
$data2 = $udpClient.Receive([ref]$remoteEndpoint2) # $ type="remote flow source"
1616

1717
$receiveTask = $udpClient.ReceiveAsync() # $ type="remote flow source"
18+
19+
$webclient = [System.Net.WebClient]::new()
20+
$data = $webclient.DownloadData("https://example.com/data.txt") # $ type="remote flow source"

0 commit comments

Comments
 (0)