SiteShadow
Back to vulnerability library
Detected byCWE-aware static analysis

CWE-798 Hard-coded Credentials

Coverage: 79 rules in the SiteShadow rule registry target this CWE (registry v2.0.0). Regex 2Secret-detect 73Other-pattern 4 Also: AI-context engineTaint and heuristic analyzers may also detect related flows (see coverage for the authoritative list) Registry tagging shows intent, for sample-level behaviour and benchmarked gaps see known gaps.

What this means

SiteShadow flagged credentials embedded directly in source code or committed configuration (API keys, tokens, passwords, private keys, "default admin" credentials).

Why it matters

Hard-coded credentials are easy to extract and abuse.

Safer examples

1) Load secrets from environment / secret manager

const apiKey = process.env.API_KEY;
if (!apiKey) throw new Error("Missing API_KEY");

2) Use short-lived credentials where possible

Prefer scoped, short-lived tokens over long-lived static keys.

3) If a secret was committed: rotate, then remove

Rotation/revocation is the "real fix." Deleting the line is not enough.

How SiteShadow detects it (high level)

References

---

← Back to Vulnerability Library

Catch this in your code with SiteShadow.

Every released SiteShadow scanner is free, including full project analysis, reports, patterns, dashboard access, and configured organization SSO.