Scanner: semgrep Severity: high Rule: cra-ai-20-csharp-unsafe-deserialization CWE: CWE-502
Description
All deserializes type information from its input, so data from outside can run code (CWE-502). Use a serializer bound to known types (System.Text.Json, DataContractSerializer, JSON.NET with TypeNameHandling.None).
## high Finding
**Scanner:** semgrep
**Severity:** high
**Rule:** cra-ai-20-csharp-unsafe-deserialization
**CWE:** CWE-502
### Description
All deserializes type information from its input, so data from outside can run code (CWE-502). Use a serializer bound to known types (System.Text.Json, DataContractSerializer, JSON.NET with TypeNameHandling.None).
### Location
**File:** `compliance-agent/rules/cra_semgrep_csharp.cs` (line 99)
### Code
```
var settings = new JsonSerializerSettings { TypeNameHandling = TypeNameHandling.All };
```
---
*Fingerprint:* `ab69b9460ef291ad5b7b4964eb745e43d7181a889045f7a28d38c2ba669393fa`
*Generated by compliance-scanner*
[Open in Prüfwerk / In Prüfwerk öffnen](https://pruefwerk.breakpilot.com/findings?target=6ae9aa2160f5d8045fc570a7)
Prüfwerk: Die Datei liegt in Testdaten (z. B. fixtures/ oder testdata/), die von der Prüfung ausgenommen sind.
The file lies in test data (such as fixtures/ or testdata/), which is left out of the scan.
**Prüfwerk:** Die Datei liegt in Testdaten (z. B. fixtures/ oder testdata/), die von der Prüfung ausgenommen sind.
The file lies in test data (such as fixtures/ or testdata/), which is left out of the scan.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
high Finding
Scanner: semgrep
Severity: high
Rule: cra-ai-20-csharp-unsafe-deserialization
CWE: CWE-502
Description
All deserializes type information from its input, so data from outside can run code (CWE-502). Use a serializer bound to known types (System.Text.Json, DataContractSerializer, JSON.NET with TypeNameHandling.None).
Location
File:
compliance-agent/rules/cra_semgrep_csharp.cs(line 99)Code
Fingerprint:
ab69b9460ef291ad5b7b4964eb745e43d7181a889045f7a28d38c2ba669393faGenerated by compliance-scanner
Open in Prüfwerk / In Prüfwerk öffnen
Prüfwerk: Die Datei liegt in Testdaten (z. B. fixtures/ oder testdata/), die von der Prüfung ausgenommen sind.
The file lies in test data (such as fixtures/ or testdata/), which is left out of the scan.