mcp-server-semgrep
Version:
MCP Server for Semgrep Integration - static code analysis with AI
67 lines (66 loc) • 1.51 kB
YAML
rules:
- id: ssrf
severity: ERROR
languages:
- csharp
metadata:
cwe:
- 'CWE-918: Server-Side Request Forgery (SSRF)'
owasp:
- A10:2021 - Server-Side Request Forgery (SSRF)
references:
- https://cheatsheetseries.owasp.org/cheatsheets/Server_Side_Request_Forgery_Prevention_Cheat_Sheet.html
category: security
technology:
- .net
confidence: LOW
cwe2022-top25: true
cwe2021-top25: true
subcategory:
- audit
likelihood: LOW
impact: MEDIUM
message: >-
SSRF is an attack vector that abuses an application to interact with the internal/external network
or the machine itself.
patterns:
- pattern-inside: |
using System.Net.Http;
...
- pattern-either:
- pattern: |
$T $F(..., $X, ...)
{
...
HttpClient $Y = new HttpClient();
...
... $Y.GetAsync(<... $X ...>, ...);
}
- pattern: |
$T $F(..., $X, ...)
{
...
$A $B = <... $X ...>;
...
HttpClient $Y = new HttpClient();
...
... $Y.GetAsync($B, ...);
}
- pattern: |
$T $F(..., $X, ...)
{
...
HttpClient $Y = new HttpClient();
...
... $Y.GetStringAsync(<... $X ...>);
}
- pattern: |
$T $F(..., $X, ...)
{
...
$A $B = <... $X ...>;
...
HttpClient $Y = new HttpClient();
...
... $Y.GetStringAsync($B);
}