When a key leaks: the order of moves, the evidence, and what past incidents teach

Contain, move value, rotate, notify, investigate, in that order, because you may be racing someone on-chain. Decide who has authority before it happens, and learn from the public incidents: logs leak keys, packages steal them, and signed intent can sit in reserve.

Read the briefing
About 3 min to read 5 drills

What to remember

  1. Assume it's real, and move. Every minute spent confirming is a minute the window stays open. You can apologise for a false alarm.
  2. Who can act at 3 a.m. is decided today. A committee loses a race to a script. Pre-agreed authority is part of the design.
  3. Evidence lives elsewhere already. An attacker with root edits local logs. If your logs weren't shipped off the box, you have little to investigate with.
  4. Logging is a leak path. Slope's wallet incident in 2022 involved seed phrases reaching a monitoring service. Your shared logging library is a security control.
  5. A signature can wait. A durable-nonce transaction stays valid until the nonce moves. Rotating a key doesn't cancel what it already signed.

The big picture

Everyone has a compromise plan until they're racing an attacker on a chain where transactions are final. The discipline is writing the order of moves in advance, bounding the blast radius before the alert fires, and rehearsing. A head of security will ask you to walk it in order, then push on the parts that hurt.

The mental model

A fire drill. Nobody works out the exits during the fire. The exits, who leads and where people meet were settled months earlier, and practised.

In depth

The order

Contain. Cut the signing path: pause the signer or revoke its access. A kill switch you've tested beats a clever fix.

Move value. To a fresh, pre-prepared address under a different key. Prepared in advance, because making a new one under stress is how mistakes happen.

Rotate. Replace the key and anything that could reach it. Don't run old and new signers at once where double-signing is a risk.

Notify. Internally straight away; customers, counterparties and regulators on whatever clock applies.

Investigate. Preserve evidence before rebuilding hosts. Find the path, and remove the class.

Three public lessons

Slope, August 2022. Thousands of wallets were drained after seed phrases were logged in plaintext to a monitoring service. Lesson: your telemetry is a leak path, so keys should be types that can't be logged.

@solana/web3.js, December 2024. Versions 1.95.6 and 1.95.7 stole keys from services that handled them directly (CVE-2024-54134), after a publish account was phished. Lesson: pin, keep the tree small near keys, and don't hand keys to application code.

Drift, April 2026. Public analyses describe governance signers' pre-signed durable-nonce transactions being used to take admin control. Lesson: signed intent can wait, so a policy should bound validity, and a multisig is only as independent as its signers. Read Drift's own post-mortem before you quote details.

Bound it before it happens

The difference between an incident and the end of the company is decided long before the alert: key tiers, value caps, separate keys per strategy, and a tested kill switch. Say your worst case as a number. If nobody knows it, you don't have one.

Myths and facts

Myth: Investigate first, so we don't overreact.

Fact: On-chain you may be racing someone. Contain first; a false alarm costs far less than a drained wallet.

Myth: Rotating the key ends the incident.

Fact: Whatever it signed still stands, including pre-signed durable-nonce transactions. Move value too, and look for what's still valid.

Myth: We'll write the plan if it happens.

Fact: You'll have minutes. Order, authority and a prepared destination must exist beforehand.

How pros do it

  • Write the order of moves, with named authority, and rehearse with dummy keys.
  • Keep a prepared destination for emergency value moves, under a different key.
  • Ship logs off the box within seconds.
  • Make keys types that can't be logged, and turn off request-body capture by default.
  • After any incident, remove the class of problem rather than the instance.

Questions people ask

How do you know a key leaked at all?

Mostly from the outside: unexpected transactions, signing rates, use from unexpected places, or a tip-off. So watch the chain for your keys rather than only your own logs. It's the one log nobody can edit.

Do you shut down trading on a suspicion?

For the affected key, yes. That's why keys are per strategy: you stop one rather than everything. Agree that in advance with the desk, because during the incident is the wrong time to argue.

When do you tell customers?

As soon as you know what they need to do, and on any legal clock. Not after the investigation is finished. Decide who writes it now, and say what you know and don't know.

Further reading

Drills · 5

Answer in your head, or out loud, before you reveal. Mark each one: "Again" brings it back, "Got it" counts on your desk.

1 Scenario: what do you do next?

03:10. Monitoring shows two transactions signed by a hot trading key that no strategy sent. The key holds working capital, and more sits in a warm wallet topped up by automation.

Step 1. First move?

  1. Stop that key signing, and stop the automatic top-up, using authority you already have. It contains the loss now. The top-up is the part people forget, and it would feed the attacker.
  2. Read the logs to work out how it happened. That matters later. Right now you may be racing someone.
  3. Call a meeting of the leadership team. A meeting loses a race against a script. Tell them while you act.

Step 2. The signer's paused. There's still value at that key's address.

  1. Move it to the prepared address under a different key, through the hardened path, if the key may be in someone else's hands. A paused signer doesn't stop someone holding a copy of the key.
  2. Leave it: the signer's paused, so it's safe. That assumes they don't have the key itself. You don't know that yet.

Step 3. Value is safe. Next?

  1. Rebuild the host straight away, to get back to trading. You'd lose the evidence, and you may rebuild the same hole.
  2. Preserve evidence before rebuilding, rotate the key and anything that could reach it, and notify on the agreed clock. Rebuild first and you've destroyed what you'd need to remove the class.
In short

Assume it's real: stop the signer and the top-up, move what's left to a prepared address, then rotate, tell people, and investigate.

Why

Contain, move value, rotate, notify, investigate. The detail that marks experience is stopping the automatic top-up, and knowing a paused signer doesn't help if the key itself left.

The common mistake

Starting with the investigation.

2 Pick the strongest answer

You've rotated a compromised Solana key and moved the funds. Why might that still not be enough, for a key that could sign durable-nonce transactions?

  1. It's enough: all signatures die when the key is rotated. A signature is valid mathematically. Nothing revokes it.
  2. Anything it signed with a durable nonce stays valid until that nonce advances, so a held signature can still land. Find the nonce accounts and advance them. Rotation stops new signatures. It doesn't cancel existing ones.
  3. Solana keeps old keys valid for 150 slots after a rotation. No such grace period exists. The 150 slots concerns blockhash expiry.
  4. The validator caches the old key for an epoch. Validators don't cache keys this way. It's about the message's validity.
In short

Transactions it already signed with a durable nonce stay valid until the nonce advances, so check for them and advance the nonces.

Why

A normal transaction dies with its blockhash in about a minute. A durable-nonce transaction doesn't, and that's the entire point of it. Public analyses of the Drift incident in April 2026 describe pre-signed transactions of this kind. So a policy should refuse them unless named, and an incident plan should look for them.

3 Answer out loud

Pick a public key or signing incident in crypto, and tell me what you changed in how you work because of it.

In short

Name one, say what actually failed, and say the specific control it taught you: for Slope, a type that can't be logged.

What a strong answer does
  • Accuracy: Says precisely what failed, and what's unknown.
  • A real change: A specific control, and why it removes the class.
  • communication: Short: what failed, what it teaches, what I do now.
Why

The interviewer is checking whether you learn from other people's failures, and whether you know them accurately. Don't quote numbers you can't source. Say what failed and what you changed. If you haven't changed anything yet, say what you would, and why.

The common mistake

Telling the story without a change at the end, or blaming the people involved.

4 Pick the strongest answer

You suspect a host was compromised. The team wants to rebuild it right away, so it's safe. What do you do first?

  1. Isolate it from the network and capture memory and disk, then rebuild. Isolation stops the harm, and the capture keeps what you'd need to find the path.
  2. Leave it running as normal, and watch what the attacker does. Not on a box near real keys.
  3. Rebuild it immediately: safety comes first. You'd remove the evidence, and you may rebuild the same hole.
  4. Reboot it, to clear anything in memory. That destroys the most useful evidence, and doesn't remove anything persistent.
In short

Isolate it and capture memory and disk before rebuilding, because a rebuild destroys the evidence you need to remove the cause.

Why

Isolate, capture, then rebuild. If you can't capture quickly, get what you can: logs off the box should already be there.

5 Quick recall

A key leak: what's the very first thing you do? One word.

In short

Contain: stop the signing path, then move value, rotate, notify and investigate.

Accepted

contain · containment · stop

Why

Contain, move value, rotate, notify, investigate. In that order, because you may be racing someone.

Next lesson Rust for platform libraries: crate APIs people adopt, secrets in types, hot-path overhead
Drill · When a key leaks
0:00

Loading…