Join our Newsletter — 33% off our NHI Course
Home› Guides› Secrets Left Unchanged After a Breach for Beginners:…
Guide Non-Human Identity (NHI)

Secrets Left Unchanged After a Breach for Beginners: Why Attackers Come Back

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, under the editorial direction of Lalit Choda Updated 1 December 2026 11 min read
On this page

An unrotated secret after a breach is a key or token the attacker saw that still works.

This guide is for anyone who helps clean up after a security incident, or who wants to know why some firms get hit twice. You do not need to be an engineer to follow it.

In short

  • Software uses API keys, tokens and passwords to reach other systems. These belong to non-human identities.
  • When attackers break in, they often copy these secrets too.
  • If the clean-up changes only some of them, a forgotten one lets the attacker walk back in.
  • The fix is a full list of exposed secrets, a new value for each one, and a check that the old ones are dead.

What you will learn

  • Explain why a breach is not over until every exposed secret is replaced.
  • Describe the repeat breach pattern seen in real incidents.
  • Tell the difference between revoking, rotating and deleting a secret.
  • Use a simple clean-up checklist after an incident.
Secret
a value, such as a key or token, that lets software prove who it is.
Rotate
swap an old secret for a new one so the old value stops working.
Revoke
switch a secret off so nobody can use it again.

What is an unrotated secret after a breach?

Imagine a burglar takes a bunch of keys from your hall table. You change the front door lock. But the back door and the garage still open with the stolen keys.

An unrotated secret works the same way. Programs use secrets to talk to databases, cloud accounts and support tools. During a breach, attackers often copy code or settings files that hold these secrets. If the victim changes only the obvious ones, the rest still work.

Well-known secrets guidance says exposed keys should be revoked at once, replaced, and removed from the exposed system [1]. Skipping any one of those steps leaves a gap.

Where the comparison stops working: you can see your doors and count them. Many firms do not have a full list of their machine secrets, so they cannot tell which "doors" the stolen keys still open.

For the basics of handling one leaked key, see Leaked Secret Response for Beginners. This page looks at what happens when the clean-up after a breach is not complete.

Why does it matter?

A missed secret turns one incident into two. The second one is often worse, because the attacker already knows the way in.

If you lead an incident clean-up

What could happen: you announce that keys were changed, but some were never on your list.

Check this: ask how the list of exposed secrets was built and who confirmed each change.

Next: Incident Response Guide

If you are a developer

What could happen: a token sits in a settings file or code repository and never expires.

Check this: keep secrets in a secrets manager, not in code.

Next: Secrets in Code for Beginners

If you run a small business

What could happen: a supplier's breach exposes the keys you gave them to reach your systems.

Check this: after any supplier breach, replace every key you shared with them.

Next: Secrets Rotation for Beginners

What does it look like?

Here is a made-up clean-up record from after a breach. The gap is easy to miss.

Example only. All values are made up.

Breach clean-up log: EXAMPLE-shop
Database password ......... rotated   (1)
Payments API key .......... rotated   (2)
Support desk token ........ not listed (3)
Cluster admin token ....... not listed (4)
Old values tested ......... no        (5)
  1. The password the team knew about was changed.
  2. The most obvious key was also changed.
  3. In a real file, this line would contain the name of a token that was in the stolen code but missing from the list.
  4. In a real file, this line would name a powerful token with no expiry date that nobody remembered.
  5. Nobody tried the old values to prove they no longer work.

Why this is risky: the two unlisted tokens still work, so the attacker can come back at any time.

The safer way: list every secret the attacker could have seen, replace each one, and test that every old value is refused.

How does it work?

  1. The first break-in. An attacker gets in and copies whatever they can reach, such as code, settings files or a database.
  2. Secrets ride along. Those files often hold the keys and tokens that let programs reach other systems.
  3. A partial clean-up. The victim changes the secrets it knows about. Secrets nobody listed stay the same.
  4. The return visit. The attacker uses a forgotten secret to get back in, sometimes weeks later.
Diagram titled Why attackers come back after a breach. Four boxes in a row joined by arrows: 1, first break-in, the attacker copies code or config; 2, secrets taken, tokens, keys and passwords go too; 3, partial clean-up, only some secrets are changed; 4, return visit, a forgotten secret still works. A note underneath says the fix is to list every secret the attacker could see, replace each one, then check none still work.
Figure 1. The repeat breach pattern: a partial clean-up leaves a way back in.

Some tokens keep working even after you act. Google notes that its service account access tokens are bearer tokens and stay valid until they expire [2]. A bearer token works for whoever holds it.

Attackers may also make new keys of their own. Google advises checking whether new service account keys, user accounts or SSH keys were created during the incident [2]. Changing the old secrets does not remove these.

Real cases show the pattern. At the Internet Archive in 2024, the attacker said many API keys from the first breach were still not rotated. One was a support desk token, reported by BleepingComputer [3]. See the Internet Archive breach page.

At Zeabur in 2026, admin tokens had no expiry and had not been rotated since January 2024. BleepingComputer reported they were left out of the rotation done after an earlier breach in August 2026 [4]. See the Zeabur second breach page.

A worked example

This story is made up to show the idea.

Noor Mbeki runs IT for a small online shop. One Monday, a researcher emails to say the shop's code is for sale on a forum. Noor checks and finds the code was copied from a test server.

Her first move is to change the database password and the payments key. Her boss is relieved. Noor is not. She knows the code held more than two secrets.

She asks Imani Castell, a developer, to search the copied code for anything that looks like a key or token. Imani finds seven. Two were already changed. Five were not, including a support desk token and an old cloud key nobody used any more.

Noor makes a list with one row per secret. For each one she records the owner, the new value's date and a test of the old value. She switches off the unused cloud key instead of replacing it.

Next she checks the cloud account's logs for the days after the break-in. She finds one extra access key that nobody on the team made. She removes it and reports it to the incident lead.

Finally she moves every live secret into a secrets manager, so none sit in code again. Two weeks later, the logs show failed attempts to use the old support desk token. The attacker tried to come back, and the door was shut.

Myths and mistakes

What people thinkWhat is true
We changed the main passwords, so we are safe.Every secret the attacker could see needs replacing, not just the obvious ones.
Restarting the app kills stolen tokens.A restart does not revoke a stolen credential. It stays valid until it expires or is revoked.[1]
Resetting a user's password ends the attacker's access.Google warns that resets do not cancel access tokens an attacker already holds.[2]
Rotation is done once the new key is in place.You also need to revoke the old one, delete copies and test that it fails.
Only the secrets we know about matter.Forgotten tokens are the ones attackers reuse. Build the list from what was exposed, not from memory.

What can I do this week?

  • Pick one system and list every key and token it uses, with an owner for each.
  • Find any secret with no expiry date and ask whether it needs one.
  • Write a one-page clean-up checklist for your team, using the checklist below.
  • Read Secrets Rotation for Beginners for how routine rotation works.
Diagram titled Clean-up order after a breach. Four boxes in a row joined by arrows: 1 Revoke, turn off every key and token that may be seen; 2 Replace, issue new secrets and update the apps; 3 Remove, delete old copies from code, config and chat logs; 4 Check, look for new keys, accounts or SSH keys added. A note says restarting a server or resetting a password does not revoke a stolen key or token.
Figure 2. The clean-up order for secrets after a breach: revoke, replace, remove, check.

Checklist

  • I list every secret that sat in the stolen code, files or systems.
  • I start with the most powerful secrets, such as admin and cloud keys.
  • I revoke each exposed secret and issue a new one where it is still needed.
  • I remove old copies from code, files and logs.
  • I test that every old value is refused.
  • I check logs for new keys or accounts the attacker may have made.
  • I give secrets an expiry date where the system allows it.
  • I keep secrets in a secrets manager, not in code or settings files.
  • I watch for anyone trying to use an old, revoked secret.

Common questions

What is the difference between revoking and rotating?

Revoking switches a secret off so it can no longer be used. Rotating swaps it for a new value. After a breach you usually do both: issue a new secret, move systems to it, then revoke the old one. OWASP also says to delete exposed copies.

Which secrets should I change first?

Start with the ones that can do the most harm if used, such as admin tokens and cloud keys. Then work through the rest of the list. The aim is to shrink the blast radius as fast as you can.

How do I know which secrets the attacker saw?

Search everything that was copied or reachable, such as code, settings files and databases. Treat every secret you find there as exposed. If you are not sure whether a system was reached, it is safer to replace its secrets too.

Why test the old secret after rotating it?

A test proves the old value is really dead. Some systems keep old keys working until they expire. Others have copies in places nobody updated. A quick test that the old value is refused closes that gap.

Can the attacker get back in another way?

Yes. They may have made new keys or accounts of their own while inside. Check logs from the incident window for anything new that your team did not create, and remove it. This is called looking for persistence.

Where next?

Ready for the detail? Read the practitioner guide: Credential Rotation at Scale. It covers how teams plan, automate and verify rotation across many systems.

Also useful:

Related NHI Mgmt Group resources: Secrets Management for Beginners, Secret Scanning for Beginners and Incident Response Guide.

Key terms

Non-human identity
A digital identity used by software, such as a service account, API key or AI agent, instead of a person.
API key
A secret value that lets one program prove itself to another program's interface.
Secrets rotation
Replacing credentials on a schedule or after an event so exposed values stop working.
Credential revocation
Switching off a secret or token so it can no longer be used.
Bearer token
A token that gives access to whoever holds it.
Blast radius
How much damage a stolen secret or identity could do.
Persistence
Anything that keeps an attacker's access alive after the first break-in.
Secrets manager
A tool that stores secrets safely and hands them to programs when needed.

Sources and further reading

  1. OWASP, "Secrets Management Cheat Sheet", OWASP Cheat Sheet Series. https://cheatsheetseries.owasp.org/cheatsheets/Secrets_Management_Cheat_Sheet.html (accessed 1 Dec 2026).
  2. Google Cloud, "Handle compromised Google Cloud credentials", Google Cloud documentation. https://docs.cloud.google.com/docs/security/compromised-credentials (accessed 1 Dec 2026).
  3. BleepingComputer, "Internet Archive breached again through stolen access tokens", October 2024. https://www.bleepingcomputer.com/news/security/internet-archive-breached-again-through-stolen-access-tokens/ (accessed 1 Dec 2026).
  4. BleepingComputer, "Zeabur shutting down after second security breach in two months", 20 October 2026. https://www.bleepingcomputer.com/news/security/zeabur-shutting-down-after-second-security-breach-in-two-months/ (accessed 1 Dec 2026).

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick both boxes to continue.