SiteShadow
Back to vulnerability library

CWE-798 Hard-coded Credentials

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

Request access View coverage