Secrets in code

beginnerCode Review

TL;DR

Hardcoded secrets — passwords, API keys, tokens — are one of the easiest and most common findings in a codebase. They leak through source, config and, notoriously, git history. Find them, get them out, and rotate them.

What it is

A secret written into the code or config is a credential sitting in plain sight for anyone who can read the repo. And “delete it later” doesn’t work — it stays in the git history unless you rewrite it.

How to find them

How to fix it

← Back to Code Review