A username, a password, and a client secret sit in a checked-in test file. The only thing between that and a breach is whether those values still work somewhere.
What goes wrong
A test fixture carries a username, a password, and a client secret in plaintext. It reads as harmless because it is 'just a test.' The value of those credentials has nothing to do with the file they live in. It depends entirely on whether they authenticate against a real environment.
If they do, then everyone with repo access, every CI job, every cached build artifact, and anyone who ever cloned the history now holds admin credentials. Version control does not forget. Deleting the line later does not rotate what already sits in a hundred local clones and the reflog.
The honest way to size this bug is to answer one question first. Are these values valid in any shared or deployed system? If yes, this is an incident and the secret needs rotating now. If they only match a local mock, it is a hygiene fix. Do not assume the second answer without checking.
The pattern
// fixture used by an integration test
const auth = {
username: 'admin-app',
password: 'S3cr3t-Passw0rd',
clientSecret: '9f8c...looks-real'
}// pull secrets from the environment at test time
const auth = {
username: env('TEST_USER'),
password: env('TEST_PASSWORD'),
clientSecret: env('TEST_CLIENT_SECRET')
}
// fixtures reference secrets, they never contain themGrounding and reachability checked out, then the exploit-path gate failed to stand up. The pipeline recorded the finding as disproven and signed that result, so the same false alarm will not come back next quarter.
Why it matters to you
Secrets in a repo are the cheapest possible win for an attacker who gets read access, and read access leaks constantly through forks, contractors, mirrors, and stolen laptops. The blast radius is set the day the secret is committed, not the day someone notices. Keep real credentials out of version control, and when one slips in, rotate it instead of only deleting the line.
Check your own code
- Scan the full commit history for passwords and client secrets, including old branches and the reflog.
- Confirm any credential found in the repo is invalid in every real environment.
- Move test secrets to environment variables or a secrets manager.
- Add a pre-commit secret scanner so the next one gets caught before it lands.