[high] semgrep: API_KEY holds a credential written into the code, so every installation ships the same secret (CWE-798). #592

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

high Finding

Scanner: semgrep
Severity: high
Rule: cra-ai-8-python-hardcoded-credential
CWE: CWE-798
CRA: cra-ai-8 — Keine Default-Passwörter (Annex I)

Description

API_KEY holds a credential written into the code, so every installation ships the same secret (CWE-798). Read it from the environment or a secret store.

Location

File: compliance-agent/rules/cra_semgrep.py (line 30)

Code

API_KEY = "sk_live_51HxYzABCDEFghijklmnopqrstuvwxyz0123456789"

Remediation

Exclude rule test fixtures from production scanning.


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

## high Finding **Scanner:** semgrep **Severity:** high **Rule:** cra-ai-8-python-hardcoded-credential **CWE:** CWE-798 **CRA:** cra-ai-8 — Keine Default-Passwörter (Annex I) ### Description API_KEY holds a credential written into the code, so every installation ships the same secret (CWE-798). Read it from the environment or a secret store. ### Location **File:** `compliance-agent/rules/cra_semgrep.py` (line 30) ### Code ``` API_KEY = "sk_live_51HxYzABCDEFghijklmnopqrstuvwxyz0123456789" ``` ### Remediation Exclude rule test fixtures from production scanning. --- *Fingerprint:* `6c82d33935bc7b5114f6fa80e94605c71a72ae871abb569b0bf6ec8366bf85bf` *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:17 +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#592