[high] semgrep: A credential (api_token) is written into the firmware source — every device ships the same secret, and it can be read… #838

Closed
opened 2026-11-04 16:32:30 +00:00 by pruefwerk · 1 comment
Member

high Finding

Scanner: semgrep
Severity: high
Rule: cra-ai-8-c-hardcoded-credential
CWE: CWE-798
CRA: cra-ai-8 — Keine Default-Passwörter (Annex I)
CRA: cra-ai-16 — Sicheres Schlüsselmanagement (Annex I)

Description

A credential (api_token) is written into the firmware source — every device ships the same secret, and it can be read out of the image (CWE-798). Provision it per device at production or first boot.

Location

File: fixtures/nightly/firmware/c-sensor-node/Core/Src/comms.c (line 10)

Code

static const char api_token[] = "sk_node_4f9a1c2e8b7d6a5f3e2d1c0b9a8f7e6d";

Remediation

Exclude fixtures/nightly from security scanning or mark it as test code.


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

## high Finding **Scanner:** semgrep **Severity:** high **Rule:** cra-ai-8-c-hardcoded-credential **CWE:** CWE-798 **CRA:** cra-ai-8 — Keine Default-Passwörter (Annex I) **CRA:** cra-ai-16 — Sicheres Schlüsselmanagement (Annex I) ### Description A credential (api_token) is written into the firmware source — every device ships the same secret, and it can be read out of the image (CWE-798). Provision it per device at production or first boot. ### Location **File:** `fixtures/nightly/firmware/c-sensor-node/Core/Src/comms.c` (line 10) ### Code ``` static const char api_token[] = "sk_node_4f9a1c2e8b7d6a5f3e2d1c0b9a8f7e6d"; ``` ### Remediation Exclude fixtures/nightly from security scanning or mark it as test code. --- *Fingerprint:* `ecf0f458673c0fa10d66508f89a6340101fd9f092d7c6118bd555271cc4a6aac` *Generated by compliance-scanner* [Open in Prüfwerk / In Prüfwerk öffnen](https://pruefwerk.breakpilot.com/findings?target=6ae9aa2160f5d8045fc570a7)
pruefwerk added the cra:annex-ipruefwerkseverity:high labels 2026-11-04 16:32:30 +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#838