Subscribe to the Non-Human & AI Identity Journal

Notifications
Clear all

Miasma npm infections: what secret and token controls failed here?


(@nhi-mgmt-group)
Member Moderator
Joined: 1 year ago
Posts: 15051
Topic starter  

TL;DR: A new Miasma wave in npm infected 57 packages, affected more than 118 GitHub repositories, and stole GitHub, npm, and cloud credentials while also hitting packages with over 647,204 monthly downloads, according to OXSecurity. The pattern shows that package-review controls alone do not contain supply chain risk when build-time execution can still harvest secrets and tokens.

NHIMG editorial — based on content published by OXSecurity covering the Miasma npm supply chain attack: Miasma is back in npm and affecting packages including @vapi-ai and ai-sdk-ollama

By the numbers:

Questions worth separating out

Q: What breaks when package installation can execute hidden build logic?

A: Package installation stops being a passive import step and becomes an execution event.

Q: Why do exposed GitHub and cloud tokens make supply chain malware so damaging?

A: Because those tokens are already trusted identities, not just files.

Q: How should security teams reduce risk in software delivery pipelines with NHI controls?

A: Start by inventorying every automation identity in the delivery chain, then convert long-lived credentials into short-lived, task-scoped access.

Practitioner guidance

  • Restrict build-time execution paths Disable or tightly control package lifecycle hooks, preinstall equivalents, and other implicit execution points in CI and developer environments.
  • Inventory and scope all pipeline credentials Map GitHub tokens, npm tokens, and cloud keys used by developers and CI systems, then reduce scope to the minimum required and assign explicit expiry.
  • Automate secret detection in repositories and build logs Search for exposed credentials in source, commit history, CI variables, and artifact logs, then tie findings to immediate revocation and rotation.

What's in the full analysis

OXSecurity's full post covers the operational detail this post intentionally leaves for the source:

  • The affected package list, version ranges, and download counts that help teams assess exposure scope.
  • The infection timeline and repository indicators that can support detection and hunting in GitHub environments.
  • The technical sequence showing how binding.gyp substituted for postinstall behaviour in this variant.
  • The prior Miasma variants and code reuse details that help teams compare campaign evolution.

👉 Read OXSecurity's analysis of the Miasma npm supply chain attack →

Miasma npm infections: what secret and token controls failed here?

Explore further

View Full Forum →  |  NHI Foundation Course →



   
Quote
(@mr-nhi)
Member Moderator
Joined: 3 months ago
Posts: 14635
 

Build-time execution is now a governance boundary, not a developer convenience. Supply chain malware like Miasma shows that install-time logic can become the real attack surface even when package content review looks clean. The control gap is not just malicious code detection, but the assumption that dependency installation is a low-risk administrative step. Practitioners should treat build hooks, preinstall equivalents, and CI execution as governed entry points.

A few things that frame the scale:

  • 92% of organisations expose NHIs to third parties, raising concerns about supply chain security, according to Ultimate Guide to NHIs.
  • Only 20% have formal processes for offboarding and revoking API keys, and even fewer have procedures for rotating them, according to Ultimate Guide to NHIs.

A question worth separating out:

Q: Who is accountable when a package repository compromise exposes enterprise credentials?

A: Accountability sits with the teams that own publishing access, dependency governance, secrets management, and endpoint containment. Frameworks such as OWASP NHI and NIST CSF matter because the failure is not only malware execution, but the absence of lifecycle control over the identities and secrets that the pipeline depended on.

👉 Read our full editorial: Miasma’s npm supply chain attack exposes secret governance gaps



   
ReplyQuote
Share: