Decoding the recommendations for npm maintainers

Decoding the recommendations for npm maintainers

The article explains GitHub’s guidance to harden npm package publishing by adopting Trusted Publishing (OIDC), enforcing stronger 2FA for publishing actions, and preferring WebAuthn/passkeys over TOTP while outlining benefits and trade-offs for CI/CD and account changes. It emphasizes replacing long‑lived tokens with ephemeral OIDC flows or scoped granular access tokens, tightening publishing settings, and adopting WebAuthn to reduce supply‑chain compromise risk. #ShaiHulud #npm

Keypoints

  • Trusted Publishing (TPF) uses OIDC to exchange short‑lived, scoped publishing credentials instead of long‑lived tokens, reducing the risk from leaked secrets.
  • TPF binds a specific CI/CD identity (e.g., a GitHub repository/workflow) to a package so npm only accepts publishes from pre‑approved provenance.
  • Current TPF support is limited to GitHub Actions (hosted runners) and GitLab CI/CD (shared runners), and each package can only have one trusted publisher configured at a time, creating potential workflow friction.
  • Two‑factor authentication should be required for publishing and sensitive operations; npm no longer allows new TOTP setups and recommends physical keys or passkeys (WebAuthn) instead.
  • For automated publishing, legacy tokens have been disabled; use either TPF or granular access tokens with limited scope and expiration to minimize blast radius.
  • TPF and WebAuthn shift trust and threat surface (to CI/CD and authenticators), so teams must still harden repository access, runner policies, and recovery plans—these controls complement, not replace, good security hygiene.

MITRE Techniques

  • [None ] No MITRE ATT&CK technique identifiers (e.g., Txxxx) are explicitly mentioned in the article.

Indicators of Compromise

  • [Domain ] Origin‑binding example used to illustrate WebAuthn protections – https://www.npmjs.com
  • [Attack Name ] Named supply‑chain incident referenced as motivation for guidance – Shai‑Hulud (high‑profile npm compromise)


Read more: https://securitylabs.datadoghq.com/articles/decoding-the-recommendations-for-npm-maintainers/