← All security rules
criticalSEC001· Secrets

Hardcoded API key or credential

A real-looking API key or credential is embedded in the source. Anyone with repo access (or the client bundle) can steal and abuse it — this is the #1 cause of surprise cloud bills in AI-generated apps.

What the check contributes

Rule SEC001runs as part of CodeCordon's deterministic static-analysis pass. When it matches, the finding includes the source file, line number, severity, explanation, and a redacted snippet so the developer can inspect the evidence directly.

Recommended remediation

Revoke this key immediately with the provider, then load it from an environment variable (process.env / os.environ) or a secrets manager. Add the value to .env and ensure .env is gitignored.

How to use this result

  1. 1. Open the reported line. Confirm the match is active application code rather than a fixture, example, or false positive.
  2. 2. Apply the remediation in context. Preserve the intended behavior while removing the dangerous pattern.
  3. 3. Scan again. Verify the known pattern no longer appears, then continue with tests and any runtime or human security review appropriate to the application.

Limits of this check

A match is a review signal, not proof of exploitability. No match means only that this specific known pattern was not found in the applicable files. It does not rule out equivalent code, business-logic flaws, runtime vulnerabilities, or novel attack paths.

Related secrets checks

Check a public repository now

Run this rule together with the complete CodeCordon rule set. No account is required for a public-repository preview.

No account required. Public repositories only. Preview links expire after 24 hours.