sprintf() writes without a bound on the destination — input longer than the buffer overflows it (CWE-120). Use a bounded call (snprintf, strncpy/strlcpy with the buffer size).
## high Finding
**Scanner:** semgrep
**Severity:** high
**Rule:** cra-ai-20-c-unbounded-string-function
**CWE:** CWE-120
**CRA:** cra-ai-20 — Automatisierte Sicherheitstests (Annex I)
### Description
sprintf() writes without a bound on the destination — input longer than the buffer overflows it (CWE-120). Use a bounded call (snprintf, strncpy/strlcpy with the buffer size).
### Location
**File:** `fixtures/nightly/firmware/c-sensor-node/Core/Src/comms.c` (line 25)
### Code
```
sprintf(reply, "ack:%s", command);
```
### Remediation
Exclude fixtures/nightly from security scanning or mark it as test code.
---
*Fingerprint:* `6dc616f97faf72f911f0762bfc1603666d70bb55879809c43fcd87f9fcfddde6`
*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-c-unbounded-string-function
CWE: CWE-120
CRA: cra-ai-20 — Automatisierte Sicherheitstests (Annex I)
Description
sprintf() writes without a bound on the destination — input longer than the buffer overflows it (CWE-120). Use a bounded call (snprintf, strncpy/strlcpy with the buffer size).
Location
File:
fixtures/nightly/firmware/c-sensor-node/Core/Src/comms.c(line 25)Code
Remediation
Exclude fixtures/nightly from security scanning or mark it as test code.
Fingerprint:
6dc616f97faf72f911f0762bfc1603666d70bb55879809c43fcd87f9fcfddde6Generated 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.