[medium] semgrep: ECB mode encrypts equal blocks to equal ciphertext, so the structure of the data shows through (CWE-327). #902

Closed
opened 2026-11-05 16:55:11 +00:00 by pruefwerk · 1 comment
Member

medium Finding

Scanner: semgrep
Severity: medium
Rule: cra-ai-13-csharp-ecb-mode
CWE: CWE-327

Description

ECB mode encrypts equal blocks to equal ciphertext, so the structure of the data shows through (CWE-327). Use AES-GCM, or CBC with a random IV and a MAC.

Location

File: compliance-agent/rules/cra_semgrep_csharp.cs (line 203)

Code

            aes.Mode = CipherMode.ECB;

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

## medium Finding **Scanner:** semgrep **Severity:** medium **Rule:** cra-ai-13-csharp-ecb-mode **CWE:** CWE-327 ### Description ECB mode encrypts equal blocks to equal ciphertext, so the structure of the data shows through (CWE-327). Use AES-GCM, or CBC with a random IV and a MAC. ### Location **File:** `compliance-agent/rules/cra_semgrep_csharp.cs` (line 203) ### Code ``` aes.Mode = CipherMode.ECB; ``` --- *Fingerprint:* `87a7f3a5891ce2deb184e3974838aabc023020c99ba3b0469d0cd1d57d0ce3bd` *Generated by compliance-scanner* [Open in Prüfwerk / In Prüfwerk öffnen](https://pruefwerk.breakpilot.com/findings?target=6ae9aa2160f5d8045fc570a7)
pruefwerk added the severity:mediumcra:annex-ipruefwerk labels 2026-11-05 16:55:11 +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#902