cfgaudit

Rules / CFG054

CFG054 high-entropy value that looks like a hardcoded secret

Severity: warn OWASP: LLM02:2026 – Sensitive Information Disclosure OWASP MCP: MCP01:2025 – Token Mismanagement & Secret Exposure — provisional (MCP Top 10 v0.1)

What cfgaudit checks

CFG007 and CFG050 detect hardcoded secrets by known vendor patterns (sk-ant-…, ghp_…, AWS, …) and secret-like key names (*_TOKEN, *_SECRET, …). Those miss a bespoke, high-entropy token stored under an innocuous key name (e.g. SESSION_KEY: a8Kd92Lmz0Qw3RtY7bVx1NpC4). CFG054 is the entropy-based fallback for exactly that case.

It scans the same surfaces — settings.json env and every MCP server's env/headers — and flags a value that:

It is deliberately conservative (warn) — entropy detection is heuristic, so the gates are tight to avoid false positives on checksums, IDs, and config blobs.

Trigger example

{ "env": { "SESSION_KEY": "a8Kd92Lmz0Qw3RtY7bVx1NpC4" } }

→ warn. A $VAR reference ("SESSION_KEY": "${SESSION_KEY}"), a short value, a git SHA, or a path is not flagged.

Safe alternative

Reference an environment variable instead of committing the literal:

{ "env": { "SESSION_KEY": "${SESSION_KEY}" } }

References

Documentation for cfgaudit 1.18.1. Source of this page · Rule implementation