Skip to content
2025 12 09 Npm Classic Tokens Revoked Session Based Auth And Cli Token Management Now Available

2025 12 09 Npm Classic Tokens Revoked Session Based Auth And Cli Token Management Now Available

github.blog • November 24, 2026

As previously announced , we’re completing the npm classic token deprecation today. This marks a major milestone in the security hardening initiative to strengthen npm’s authentication system.

What’s changing today (December 9, 2025)

npm classic tokens permanently revoked

We’ve permanently revoked all existing npm classic tokens. They can no longer authenticate, be recreated, or be recovered.

New session-based authentication

Starting today, when you use npm login you’ll receive a two-hour session token instead of long-lived tokens. These sessions automatically expire after two hours, requiring reauthentication to continue publishing. Unlike traditional tokens, session tokens won’t appear in your UI or CLI token lists—they work behind the scenes to maintain your authenticated session. During these sessions, 2FA is enforced for publishing operations, adding an extra layer of security.

New CLI token management tool for granular tokens

npm is introducing a new command-line tool specifically designed for managing granular access tokens. This new CLI tool provides the ability to create, list, and revoke granular tokens directly from your terminal, eliminating the need to visit the npm website for token management.

This provides the same convenient command-line experience previously available only for classic tokens.

Full documentation for the new token management commands will be available in the npm CLI documentation .

Secure-by-default 2FA for new packages (new)

Starting this week, 2FA enforcement is shifting to become the default option for all new package publications. When you create a new package, 2FA will be enabled by default in the package settings. This ensures packages are protected from the moment they’re created without requiring manual security configuration. Existing packages retain their current 2FA settings.

Legacy API endpoint support temporarily restored

We’ve temporarily restored support for the legacy API endpoint ( /user/org.couchdb.user: ) that was causing compatibility issues in November. This endpoint now generates the same two-hour session tokens used by npm login , requiring re-authentication every two hours when publishing.

This is a temporary measure to provide a transition period. The removal of this legacy endpoint is imminent and planned for the coming months. We strongly recommend migrating to modern authentication methods now to avoid disruption.

Note: This endpoint primarily affects users of Yarn v1 and v2. If you’re using these versions, we recommend updating to modern package managers or authentication methods that support current npm security standards.

If you were still using npm classic tokens

Your npm classic tokens stopped working today. Here’s how to restore access:

For local development, run npm login to create a new two-hour session. You’ll need to reauthenticate periodically, but this ensures better security.

For CI/CD workflows, create granular access tokens using the new CLI commands ( npm token create ) or at npmjs.com/settings/~/tokens . When setting up these tokens, you may enable Bypass 2FA for noninteractive automated workflows and set appropriate expiration (write tokens limited to 90 days maximum). For the most secure deployment, consider adopting OIDC trusted publishing , which eliminates the need to generate and manage tokens for publishing packages.

Thank you for your patience as we strengthen npm’s security. These changes protect the entire JavaScript ecosystem while maintaining the workflows you depend on. For more details on our security roadmap and ongoing improvements, see our community discussion .

The full story

This article is one source in a clustered incident — the cluster page carries the summary, timeline and every other outlet covering it.

Malicious npm Packages and AI Tooling Attacks Reshape Software Supply Chain Risk in 2026 Databricks analyzed approximately 5,400 confirmed malicious npm packages published between December 2025 and October 2026, the first year after npm revoked long-lived authentication tokens. Attacker-created malware packages made up 89% of the set but 0.2% of recorded downloads, while compromised legitimate packages made up 7% of the set and over 99% of downloads. Databricks reports that 85% of packages published via trusted publishing in the set are compromised legitimate packages, and links this to attackers taking over CI environments after token revocation, including the August 2026 self-replicating worm campaign. Databricks reports that 54% of packages declare a lifecycle script, and that the largest campaign of the period, exceeding one thousand packages aimed at a single organization, declared one in 1% of its packages. Databricks also reports that 38% of malicious packages communicate with legitimate third-party services, and describes a class of activity targeting AI development tools such as MCP servers and AI assistant configuration. Ox Security analyzed 542,207 components across npm, PyPI, MCP servers and Agent Skills between July and October 2026. Ox reports that prompt injection and tool poisoning appeared in 22% of flagged MCP servers, compared with 16% for install or import-time execution. Ox reports that 82% of researcher-confirmed malicious components were already malicious in their first observed version. Ox reports that two accounts controlled 44% of flagged MCP servers, with one publishing 2,364 servers in 17 days. Neither article cites CVEs or a patch, and the sources describe trends rather than a single named incident. 3 sources 67

Extracted Entities

Domains (1)

Tools (1)