Token rotation usually comes first when there is evidence of credential exposure, because live publishing access can be abused immediately. Provenance controls still matter, but a stolen maintainer token can undermine every downstream assurance layer until it is revoked and replaced.
Why this is usually a token rotation decision first
In npm supply chain defence, the first question is whether an attacker already has live publishing access. If a maintainer token, session, or other publishing credential is exposed, that access can be abused immediately, before provenance checks can help. That is why rotation, revocation, and re-issuance usually take priority over provenance hardening when compromise is suspected.
A useful way to frame the decision is that provenance controls answer, “Can we trust what gets built and published?”, while token rotation answers, “Can anyone publish as us right now?” Those are both important, but they do not carry the same urgency once a credential leak is in play. Rotation reduces the active blast radius first, then provenance can help restore confidence in future releases. For credential lifecycle and rotation discipline, see Guide to NHI Rotation Challenges.
Where provenance controls matter most
Package provenance becomes the higher-value control when the immediate concern is release integrity rather than active credential exposure. Trusted publishing, signed artifacts, and build attestation reduce the chance that a poisoned package is accepted downstream even if a maintainer workflow is manipulated. In practice, provenance is strongest when it is paired with controlled publishing paths and reproducible release discipline, not treated as a substitute for access control.
That distinction matters in npm because attackers often target the publishing identity first, then use that access to publish code that looks legitimate. A poisoned package can spread quickly through automated consumers, so provenance helps buyers and downstream pipelines decide whether the artifact they received is actually the one the maintainer intended. For supply-chain context and release assurance, SLSA and NIST SSDF (SP 800-218) are the most useful external anchors.
For npm-specific risk, the most relevant lesson is that provenance reduces trust in unsigned or poorly attested artifacts, but it does not invalidate a compromised maintainer account on its own. If the publisher can still authenticate, the attacker can still push a malicious release path unless the token is revoked first. A real-world example of how maintainer access becomes an attack path is axios npm compromise 2026.
What teams should do when both controls are needed
The practical order is: confirm whether publishing credentials are exposed, rotate or revoke them first, then add or strengthen provenance controls for the release pipeline. If there is no sign of compromise, provenance hardening can lead the programme work. If there is any sign of token theft, published malware, or suspicious package activity, treat credential replacement as the immediate containment step. The team that owns release access should also own the evidence trail for who can publish, how quickly secrets can be replaced, and how downstream consumers verify provenance.
For npm supply-chain operations, the strongest control combination is live credential containment plus release integrity assurance. You need both, but they solve different failure modes. Rotation stops active abuse; provenance reduces the chance that a bad artifact is trusted after publication. When those two are combined, a compromised maintainer has less room to publish, and a downstream consumer has better evidence to reject tampered packages. The broader package-security pattern is illustrated by Shai Hulud npm malware campaign and Nx s1ngularity attack 2025.
Risk and Threat Considerations
Credential exposure creates immediate attacker value because npm publishing access can be used to ship a malicious update before anyone notices. Provenance still matters, but it usually cannot compensate for an active, valid token that continues to authorize publication. The highest-risk failure mode is therefore not weak provenance by itself, but compromised publishing access combined with fast downstream consumption.
Failure mechanism: An attacker who steals a maintainer token can publish a tainted package, sign or attest it through the normal workflow if the pipeline permits it, and reach consumers before detection or revocation.
Impact: The resulting compromise can propagate through dependency trees, expose secrets, and undermine trust in every later release until the publishing credential is revoked and replaced.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
MITRE ATT&CK and OWASP Non-Human Identity Top 10 address the attack and risk surface, while SLSA and NIST SP 800-53 Rev 5 set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| SLSA | Supply chain levels for software artifacts | npm provenance and artifact integrity are central to the release-trust decision. |
| Recommendation — Adopt stronger provenance and integrity checks for published packages. | ||
| NIST SP 800-53 Rev 5 | IA-5 — Authenticator Management | Publishing token rotation and revocation are authenticator lifecycle controls. |
| SI-7 — Software, Firmware, and Information Integrity | Package provenance and tamper detection directly support release integrity. | |
| Recommendation — Rotate and revoke exposed publishing tokens immediately. Verify release integrity before trusting package updates. | ||
| MITRE ATT&CK | T1552 — Unsecured Credentials | Stolen npm tokens and exposed secrets are the attacker mechanism that drives urgency. |
| Recommendation — Hunt for exposed credentials and remove any surviving publishing access. | ||
| OWASP Non-Human Identity Top 10 | NHI-02 — Secret Leakage | Leaked maintainer tokens are the immediate risk in this npm supply-chain scenario. |
| Recommendation — Treat leaked publishing secrets as an urgent containment event. | ||
Practitioner Guidance
Decision rule: If you have evidence or a credible suspicion of token exposure, rotate first and validate that old publishing paths are dead before investing effort in provenance tuning. If the issue is governance maturity rather than suspected compromise, prioritise trusted publishing, attestation, and build integrity controls.
What to verify: Confirm which npm tokens, CI secrets, or maintainer sessions can still publish, whether any automation bypasses human review, and whether downstream consumers can distinguish an attested release from an unauthenticated one. The control is only real if the old secret cannot publish and the new release path is observable.
Practitioner takeaway: In live compromise scenarios, token rotation is the containment control and provenance is the confidence control, so do not let release assurance work delay revoking a credential that can still publish.
Related resources from NHI Mgmt Group
- Should teams prioritise provenance controls or malware scanning for package supply chain risk?
- Which controls should teams prioritise after a package supply chain compromise?
- Should teams prioritise zero standing privilege or token rotation first for MitM defence?
- Should retailers prioritise account takeover defence or supply chain controls first?
Deepen Your Knowledge
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.
Reviewed and updated by the NHIMG editorial team on October 13, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org