std::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
std::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/cli.cpp` (line 11)
### Code
```
std::sprintf(out, "sensor-node %s", version);
```
### Remediation
Exclude fixtures/nightly from security scanning or mark it as test code.
---
*Fingerprint:* `acbeaf4067fc50c720aca89f351ad72ace2983f8fe819425a130fb4620f71ef6`
*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
std::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/cli.cpp(line 11)Code
Remediation
Exclude fixtures/nightly from security scanning or mark it as test code.
Fingerprint:
acbeaf4067fc50c720aca89f351ad72ace2983f8fe819425a130fb4620f71ef6Generated 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.