[high] semgrep: LosFormatter deserializes type information from its input, so data from outside can run code (CWE-502). #600

Closed
opened 2026-11-03 19:26:23 +00:00 by pruefwerk · 1 comment
Member

high Finding

Scanner: semgrep
Severity: high
Rule: cra-ai-20-csharp-unsafe-deserialization
CWE: CWE-502
CRA: cra-ai-20 — Automatisierte Sicherheitstests (Annex I)

Description

LosFormatter 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 96)

Code

            var los = new LosFormatter();

Fingerprint: 0572ff7c9219accb3b6efa6e22602ecd9c8577edac6539b11ce8a517c9163c83
Generated by compliance-scanner
Open in Prüfwerk / In Prüfwerk öffnen

## high Finding **Scanner:** semgrep **Severity:** high **Rule:** cra-ai-20-csharp-unsafe-deserialization **CWE:** CWE-502 **CRA:** cra-ai-20 — Automatisierte Sicherheitstests (Annex I) ### Description LosFormatter 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 96) ### Code ``` var los = new LosFormatter(); ``` --- *Fingerprint:* `0572ff7c9219accb3b6efa6e22602ecd9c8577edac6539b11ce8a517c9163c83` *Generated by compliance-scanner* [Open in Prüfwerk / In Prüfwerk öffnen](https://pruefwerk.breakpilot.com/findings?target=6ae9aa2160f5d8045fc570a7)
pruefwerk added the pruefwerkcra:annex-iseverity:high labels 2026-11-03 19:26:23 +00:00
Author
Member

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.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: platform/pruefwerk#600