The hard-coded credential rule for C (cra-ai-8-c-hardcoded-credential) matches variable initialisers such as const char* password = "...". It misses the usual embedded style, #define WIFI_PASS "..." and #define API_KEY "...", so most ESP-IDF and STM32 projects give no hits.
Done when
#define macros whose name looks like a credential (PASS, PASSWORD, PWD, SECRET, TOKEN, API_KEY, PSK, …) and whose value is a non-empty string literal are reported.
Placeholders ("", "changeme", "YOUR_…", "xxx") are ignored.
Tests, and the rule id in the nightly C fixture.
Part of #338.
## Problem
The hard-coded credential rule for C (`cra-ai-8-c-hardcoded-credential`) matches variable initialisers such as `const char* password = "..."`. It misses the usual embedded style, `#define WIFI_PASS "..."` and `#define API_KEY "..."`, so most ESP-IDF and STM32 projects give no hits.
## Done when
- `#define` macros whose name looks like a credential (PASS, PASSWORD, PWD, SECRET, TOKEN, API_KEY, PSK, …) and whose value is a non-empty string literal are reported.
- Placeholders (`""`, `"changeme"`, `"YOUR_…"`, `"xxx"`) are ignored.
- Tests, and the rule id in the nightly C fixture.
sharang
added this to the Production MVP milestone 2026-09-25 07:59:07 +00:00
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.
Part of #338.
Problem
The hard-coded credential rule for C (
cra-ai-8-c-hardcoded-credential) matches variable initialisers such asconst char* password = "...". It misses the usual embedded style,#define WIFI_PASS "..."and#define API_KEY "...", so most ESP-IDF and STM32 projects give no hits.Done when
#definemacros whose name looks like a credential (PASS, PASSWORD, PWD, SECRET, TOKEN, API_KEY, PSK, …) and whose value is a non-empty string literal are reported."","changeme","YOUR_…","xxx") are ignored.