Join our Newsletter — 33% off our NHI Course
Home› Guides› Revoking Credentials When Malware Has a Dead-Man Switch:…
Guide Secrets Management

Revoking Credentials When Malware Has a Dead-Man Switch: Isolate, Remove, Then Revoke Safely

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, edited by Lalit Choda Updated 18 November 2026 12 min read
On this page

Some credential-stealing malware now watches the token it stole and destroys data on the infected machine the moment that token stops working, so the usual first move of "revoke everything now" can trigger the damage you are trying to prevent. This guide sets out a safe order for incident responders: contain the host, find and remove the watcher, preserve evidence, and only then revoke and replace credentials, without leaving the attacker a long window to use what they stole.

It is written for incident responders, security engineers and platform teams handling developer workstation and CI compromises, especially those from npm and other package supply chain attacks. It complements our API Key Leak Response Playbook, which covers the normal case where revocation carries no risk to the host.

Key takeaways

  • A dead-man switch is malware logic that checks whether a stolen credential still works and runs a destructive action when it does not. Revoking the credential, from anywhere, is the trigger.
  • In the October 2026 tensorlake compromise, Socket found a monitor that polls GitHub with the stolen token and, when the token is revoked, runs a handler designed to wipe the user's home directory "regardless of where the revocation is done" (Socket).
  • Socket's advice is explicit: "Remove the token monitor before revoking any tokens." Isolate the host, remove the persistence, then revoke.
  • Speed still matters. The goal is minutes to hours between detection and revocation, not days. Plan the sequence in advance so you can run it quickly.
  • When you cannot reach a host to remove the watcher, decide deliberately: accept the possible loss of that host's data to cut off the attacker, or keep the credential live for a short, monitored window. Record who made the call and why.

What a credential dead-man switch is

Most stealers grab credentials, send them out and move on. A dead-man switch adds a second component that stays on the host. It periodically uses the stolen credential to make a harmless call, such as asking an API "who am I?". While the call succeeds, nothing happens. When it fails because the credential has been revoked, the component runs a destructive routine.

The design aims to punish defenders for the most natural response. It turns the victim's data into a hostage, and it encourages delay, which gives the attacker more time to use the stolen credential. The destructive outcome maps to MITRE ATT&CK T1485 Data Destruction and, where disks are targeted, T1561 Disk Wipe.

The key point for responders is that revocation is a remote event. You may revoke a token in a provider console thousands of miles from the infected laptop, and the laptop will still react. Socket notes the wipe occurs "regardless of where the revocation is done".

The tensorlake and Shai-Hulud case

On 8 October 2026 a malicious version of the npm package tensorlake, 0.5.144, was published from the project's own pipeline. Endor Labs says the payload hunts for npm tokens, SSH keys, cloud credentials for AWS, Google Cloud and Azure, Kubernetes and Docker configuration, HashiCorp Vault tokens, CI and registry tokens, GitHub CLI configuration and environment files, and probes cloud metadata endpoints for short-lived credentials (Endor Labs). Version 0.5.143 and earlier were not affected.

Socket's analysis found the "hostage token" component. It describes a monitor that polls the GitHub user endpoint with the stolen token and, once the token is revoked, runs an attacker-supplied handler that wipes the user's home directory. Socket also notes that a string seen in the code, warning that revoking the token will wipe the owner's computer, appeared in earlier Shai-Hulud waves, which helps link samples to the same family.

For the full incident, see the Tensorlake npm worm 2026 analysis. For the wider worm family, see our Shai-Hulud npm Worm Guide.

Why the usual revocation order fails here

Standard leaked-credential playbooks put revocation first, and for good reason. A leaked key on a public repository is being used by someone else right now, and every minute counts. Most leaked-credential runbooks, including our own, follow that order.

The dead-man switch changes the trade-off in three ways:

  • Revocation has a cost on the host. A developer's home directory holds source code, unpushed work, local keys and configuration. Losing it slows recovery and destroys evidence.
  • Revocation destroys evidence. The same wipe removes the artefacts you need to work out what ran, what was taken and where it went.
  • One token, many hosts. A token stolen from a CI runner and a laptop may have watchers on both. Revoking once triggers every watcher at the same time.

The answer is not to stop revoking. It is to put a short, well-rehearsed containment step in front of revocation. Our Containment vs Eradication guide explains the general distinction.

The safe revocation order

The sequence below follows Socket's published clean-up order for tensorlake and generalises it for other families. Run it as one coordinated operation, with a single incident lead, rather than letting different teams revoke on their own.

  1. Scope the exposure. Identify every host and pipeline where the malicious package or payload ran. Use lockfiles, package caches, artefact repositories and EDR telemetry. CISA's guidance for the 2025 Shai-Hulud wave starts the same way: check lockfiles and cached copies of affected packages (CISA).
  2. Freeze changes to the stolen credentials. Tell every team not to revoke, rotate or delete the affected tokens until the incident lead says so. A well-meaning engineer rotating a token early can set off every watcher.
  3. Isolate affected hosts from the network. Use EDR network containment or pull the host off the network. An isolated host cannot reach the provider to check its token, so revocation elsewhere will not be observed, and it cannot fetch new instructions. Keep the host powered on so memory and volatile evidence survive. Our Live Response vs Dead-Box Forensics guide covers the trade-offs.
  4. Find and remove the watcher. Hunt for the persistence the family uses and disable it. For tensorlake, Socket lists the locations shown in the table below. Socket also stresses that removing the npm package alone does not remove the implant.
  5. Preserve evidence. Capture the watcher's files, persistence entries and relevant logs before deleting anything, so that analysts can confirm what it was designed to do.
  6. Revoke and replace credentials. Once every in-scope host is isolated and cleaned, revoke the stolen credentials at the issuer and issue replacements. Start with the token the watcher checks, then everything else that was on the host.
  7. Audit what the credentials did. Review provider logs for new tokens, unexpected publishes, repository creation, workflow changes and cloud API calls during the exposure window.
  8. Rebuild, then restore access. Rebuild affected hosts and runners from trusted images, and only then give them access to secrets again. Socket recommends a verified clean release before restoring access to secrets.

Known persistence locations for the tensorlake watcher

These indicators are from Socket's analysis. Other families will differ, so treat this as an example, not a complete list.

PlatformPersistence reported by SocketATT&CK technique
WindowsAn ONLOGON scheduled task running monitor.ps1T1053.005 Scheduled Task
LinuxA user systemd service gh-token-monitor.service and the directory ~/.config/gh-token-monitor/T1543.002 Systemd Service
macOSA LaunchAgent at ~/Library/LaunchAgents/com.user.gh-token-monitor.plistT1543.001 Launch Agent

When you cannot reach the host

Sometimes the infected machine is a contractor's laptop, an ephemeral runner that has already been recycled, or a host you cannot isolate quickly. You then face a real decision rather than a procedure.

Option one: revoke now and accept the risk to that host

If the credential grants broad access, such as publish rights to widely used packages, organisation-wide source control access or production cloud access, the harm from continued misuse usually outweighs the loss of one host's data. Revoke, warn the host's owner, and plan to rebuild it.

Option two: keep the credential live for a short, watched window

If the credential has narrow scope and the host holds data you cannot afford to lose, you may hold revocation for a short, defined period while you reach the host. During that window, reduce what the credential can do without revoking it where the provider allows, watch its use closely, and block known attacker infrastructure at the network edge. Set a hard deadline after which you revoke regardless.

Record the decision

Whichever option you choose, record who decided, what they knew, and the deadline. This is the kind of decision regulators, insurers and post-incident reviews will ask about later.

Ephemeral CI runners need special mention. If a runner has already been destroyed, the watcher went with it, and you can usually revoke straight away. Confirm the runner is gone and that no persistent cache or self-hosted runner survived before relying on this.

Preparing before the next incident

A safe order only works if you can run it fast. Most of the preparation is identity work done in advance.

  • Short-lived credentials by default. Tokens that expire within hours limit how long the attacker can use them and reduce the pressure to revoke instantly. Replace long-lived npm and GitHub tokens with trusted publishing and short-lived tokens where possible. Our npm Token Changes and Trusted Publishing guide covers this.
  • Scoped credentials. A token with narrow permissions is a token you can afford to keep live for a short window if you must.
  • Network containment ready to use. Confirm that EDR network isolation works on developer laptops and self-hosted runners, and that the incident team has rights to trigger it.
  • Backups of developer workstations. If the home directory is backed up, the cost of the wipe drops and the decision to revoke becomes easier.
  • A credential map per host type. Know which credentials typically live on a developer laptop, a CI runner and a build server, so you can scope revocation quickly.
  • Install-time controls. Disable install scripts by default where practical, as Endor Labs suggests, and pin dependencies to known good versions. Our npm Install-Time Security Guide goes further.
  • A rehearsed runbook. Add a "check for dead-man switch" decision point to your secrets leak runbook and exercise it.

Detection signals for watcher components

You can often spot a watcher before you need to act on it.

  • New persistence created by package managers. Scheduled tasks, systemd user services or LaunchAgents created shortly after an npm, pip or similar install are high-signal events.
  • Periodic identity checks from unusual processes. A script interpreter calling a source control "current user" endpoint on a timer, from a host where no developer tool should do so, deserves investigation.
  • Token use from two places at once. The same token calling the provider from the victim's host and from attacker infrastructure is a sign of theft. Provider audit logs show this.
  • Known strings and names. Family-specific strings, file names and service names, such as those Socket lists for tensorlake, are useful for hunting across the fleet.

Feed these into your EDR and SIEM rules. Our EDR Guide covers telemetry sources.

Mapping to frameworks

Common failure patterns

  • Revoking before scoping. Teams revoke the token in the first minutes and lose every affected home directory at once.
  • Uncoordinated rotation. Several teams rotate their own credentials on their own schedule, triggering watchers piecemeal and confusing the timeline.
  • Removing the package, not the implant. Uninstalling the malicious package leaves the watcher running, as Socket points out.
  • Powering off to be safe. Shutting down the host loses volatile evidence. Network isolation usually achieves the goal without that loss.
  • Waiting indefinitely. Fear of the wipe turns into days of delay, during which the attacker uses the credentials freely.
  • Forgetting the other credentials. Responders focus on the watched token and leave cloud, registry and SSH keys from the same host unrotated.
  • Restoring secrets to unrebuilt hosts. Giving a cleaned but not rebuilt host new credentials invites reinfection.

Practitioner checklist

  • Add a dead-man switch check to your leaked credential runbook before the revocation step.
  • Name a single incident lead who authorises revocation for supply chain compromises.
  • Confirm EDR network isolation works on developer laptops and self-hosted runners.
  • Keep hunting queries for watcher persistence on Windows, Linux and macOS.
  • Preserve watcher artefacts before removal.
  • Revoke the watched token first once hosts are clean, then every other credential from those hosts.
  • Set a hard deadline for any decision to keep a stolen credential live, and record it.
  • Move to short-lived, scoped tokens and trusted publishing to reduce the stakes next time.
  • Back up developer workstations so a wipe is recoverable.
  • Rebuild affected hosts and runners before restoring access to secrets.

Standards and references

Related NHI Mgmt Group resources: API Key Leak Response Playbook · Shai-Hulud npm Worm Guide · Wiper Attack Response Playbook · Workload Identity Compromise Response Playbook

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.

NHIMG Editorial Note
Researched and written by the NHI Mgmt Group editorial team using AI tools, under the editorial direction of Lalit Choda. Facts are drawn from the sources listed on this page and checked by our automated quality process. Last updated 18 November 2026. Spotted an error? Use our contact page.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM and Agentic AI security. nhimg.org

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 the PDF box to continue.