Scanner: semgrep Severity: high Rule: cra-ai-20-csharp-unsafe-deserialization CWE: CWE-502
Description
NetDataContractSerializer 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
NetDataContractSerializer 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 93)
### Code
```
var ndcs = new NetDataContractSerializer();
```
---
*Fingerprint:* `78c5a7c8f627519a75403c2e8fe4f3bf8ecfa37d94af5eb2de1b7248fc56077f`
*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
NetDataContractSerializer 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 93)Code
Fingerprint:
78c5a7c8f627519a75403c2e8fe4f3bf8ecfa37d94af5eb2de1b7248fc56077fGenerated 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.