mirror of
https://github.com/github/codeql.git
synced 2026-03-30 20:28:15 +02:00
Merge pull request #21410 from MathiasVP/add-WebSocket-ReceiveAsync-model
C#: Add `System.Net.WebSockets.ReceiveAsync` as a remote flow source
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
---
|
||||
category: minorAnalysis
|
||||
---
|
||||
* Added `System.Net.WebSockets::ReceiveAsync` as a remote flow source.
|
||||
6
csharp/ql/lib/ext/System.Net.WebSockets.model.yml
Normal file
6
csharp/ql/lib/ext/System.Net.WebSockets.model.yml
Normal file
@@ -0,0 +1,6 @@
|
||||
extensions:
|
||||
- addsTo:
|
||||
pack: codeql/csharp-all
|
||||
extensible: sourceModel
|
||||
data:
|
||||
- ["System.Net.WebSockets", "WebSocket", True, "ReceiveAsync", "", "", "Argument[0]", "remote", "manual"]
|
||||
@@ -44,5 +44,13 @@ namespace RemoteFlowSource
|
||||
{
|
||||
Use(request.Unvalidated.RawUrl);
|
||||
}
|
||||
|
||||
public static async void M3(System.Net.WebSockets.WebSocket webSocket)
|
||||
{
|
||||
var buffer = new byte[1024];
|
||||
var segment = new ArraySegment<byte>(buffer);
|
||||
var result = await webSocket.ReceiveAsync(segment, System.Threading.CancellationToken.None);
|
||||
Use(segment);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,3 +9,4 @@
|
||||
| RemoteFlowSource.cs:40:17:40:23 | access to parameter request | ASP.NET query string |
|
||||
| RemoteFlowSource.cs:45:17:45:23 | access to parameter request | ASP.NET query string |
|
||||
| RemoteFlowSource.cs:45:17:45:42 | access to property RawUrl | ASP.NET unvalidated request data |
|
||||
| RemoteFlowSource.cs:52:55:52:61 | [post] access to local variable segment | external |
|
||||
|
||||
@@ -185,6 +185,10 @@ source
|
||||
| System.IO;StreamWriter;StreamWriter;(System.String,System.IO.FileStreamOptions);Argument[this];file-write;manual |
|
||||
| System.IO;StreamWriter;StreamWriter;(System.String,System.Text.Encoding,System.IO.FileStreamOptions);Argument[this];file-write;manual |
|
||||
| System.Net.Sockets;TcpClient;GetStream;();ReturnValue;remote;manual |
|
||||
| System.Net.WebSockets;ClientWebSocket;ReceiveAsync;(System.ArraySegment<System.Byte>,System.Threading.CancellationToken);Argument[0];remote;manual |
|
||||
| System.Net.WebSockets;ClientWebSocket;ReceiveAsync;(System.Memory<System.Byte>,System.Threading.CancellationToken);Argument[0];remote;manual |
|
||||
| System.Net.WebSockets;WebSocket;ReceiveAsync;(System.ArraySegment<System.Byte>,System.Threading.CancellationToken);Argument[0];remote;manual |
|
||||
| System.Net.WebSockets;WebSocket;ReceiveAsync;(System.Memory<System.Byte>,System.Threading.CancellationToken);Argument[0];remote;manual |
|
||||
| System;Console;Read;();ReturnValue;stdin;manual |
|
||||
| System;Console;ReadKey;();ReturnValue;stdin;manual |
|
||||
| System;Console;ReadKey;(System.Boolean);ReturnValue;stdin;manual |
|
||||
|
||||
Reference in New Issue
Block a user