Software supply chain

AsyncAPI npm compromise: a pwn request, a stolen bot token and malware with valid provenance

A GitHub Actions pwn request leaked a bot token, and AsyncAPI's own pipeline published five malicious npm versions with valid provenance. How to harden CI/CD.

All articles

On 14 July 2026, five malicious versions of four packages in the @asyncapi npm namespace, including the widely used @asyncapi/specs, were published through the AsyncAPI project’s own release pipelines. They carried a hidden loader that runs the moment a program imports the library, and every one of them shipped with valid provenance attestations. npm removed all five versions by 11:18 UTC the same day, a little over four hours after the first malicious push.

Three weeks on, with AsyncAPI’s post-mortem and several independent analyses public, the lesson is clear for any team that builds or consumes open-source packages. The attacker did not steal an npm token or break into the registry. They abused a GitHub Actions workflow that ran untrusted pull-request code with privileged access, took a bot credential, and let the legitimate pipeline do the rest. Provenance did exactly what it is designed to do, and that was not enough.

What happened

AsyncAPI is an open-source initiative for describing event-driven APIs. According to its post-mortem, a workflow that built documentation previews for pull requests, manual-netlify-preview.yml, used the pull_request_target trigger. That trigger runs in the security context of the base repository, with access to its secrets and a write-capable token, yet the workflow checked out and built code from the contributor’s fork. GitHub Security Lab has warned since 2021 that this combination is “a dangerous practice that may lead to repository compromise”. The pattern is commonly called a “pwn request”.

The weakness was known. Microsoft’s analysis notes that a proof of concept on 29 April examined whether untrusted pull-request content could run in that workflow, and that a fix separating untrusted builds from secret-bearing steps was proposed on 17 May. AsyncAPI says the fix (PR #2092) was still unmerged on the day of the attack.

Timeline (14 July 2026, UTC)

  • 05:04 A flood of spam pull requests begins on the asyncapi/generator repository.
  • 05:08 The exploit pull request (#2155) is slipped in among them.
  • 05:16 The privileged preview workflow runs on that pull request. Per AsyncAPI, the credentials of asyncapi-bot, an automation account with administrative access across the organization, are exfiltrated. The pull request is closed.
  • 06:58 A malicious commit is pushed directly to the generator repository’s next branch.
  • 07:10 The release workflow publishes @asyncapi/generator@3.3.1, @asyncapi/generator-helpers@1.1.1 and @asyncapi/generator-components@0.7.1 through npm trusted publishing.
  • 07:51 The attacker pivots to asyncapi/spec-json-schemas with the same credential.
  • 08:06 and 08:30 @asyncapi/specs@6.11.2-alpha.1 and then @asyncapi/specs@6.11.2 are published.
  • 08:40 Maintainers downgrade the bot to read-only and rotate tokens.
  • 11:18 npm purges all five versions.

Microsoft, writing the day after the attack, was more cautious about the first step: it said the logs alone did not establish how the credential was obtained.

Estimates of reach vary. BleepingComputer put the combined weekly downloads of the affected packages above 2.25 million, while StepSecurity counted 2.66 million a week for @asyncapi/specs alone, a package that other AsyncAPI tools such as @asyncapi/parser pull in as a dependency. The last safe versions are generator 3.3.0, generator-helpers 1.1.0, generator-components 0.7.0 and specs 6.11.1.

The payload

The loader declared no install scripts. It fires when the module is loaded through require or import, spawns a hidden background Node.js process, fetches a second stage from IPFS and stores it as sync.js in a “NodeJS” folder under the user’s application-data directory. Microsoft stresses that the common npm install --ignore-scripts mitigation “does not neutralize it”. The final stage is a modular remote-access framework that uses the Miasma name; AsyncAPI notes that it has minimal direct association with the broader Miasma malware family and calls it M-RED-TEAM instead. It installs persistence and can fail over between command channels including HTTP, Nostr relays, an Ethereum contract, BitTorrent DHT, libp2p and IPFS, so blocking one address does not cut it off.

Its code targets browser credentials, SSH keys, npm, GitHub and cloud tokens, and other secrets. Microsoft reported that credential harvesting was disabled in this build, and Aikido, cited by BleepingComputer, found that the harvesting tool exits before collecting anything. Neither finding means affected machines are clean: the backdoor’s remote shell allows manual access, so any machine that imported an affected version should be treated as compromised.

Why it matters

Provenance proves where, not what. Provenance attestations and npm trusted publishing, which uses short-lived OIDC credentials, remove long-lived npm tokens and let consumers verify that a package came from a specific repository, workflow and commit. In this case all of that was true. As StepSecurity put it, the attestations proved “only that the project’s authorized workflow produced them, not that the triggering commits were legitimate”. AsyncAPI’s post-mortem reaches the same conclusion: OIDC validates where a request originates, not the integrity of the code changes behind it.

The CI pipeline is part of the supply chain. AsyncAPI’s post-mortem traces the incident to a chain of weaknesses that lined up: a pull_request_target workflow that ran fork code; a bot with administrative write access across the organization; branch protections that did not bind administrators, which allowed direct force-pushes to release branches; and an automated publish path with no environment-based approval gate. Each is common; together they turned one pull request into a release.

Attackers now target maintainers’ attention. The spam flood buried the malicious run in noise, and rewritten history left the closed pull request with no suspicious diff. Import-time execution also sidesteps the most common consumer control, disabling install scripts.

The fix already existed. A security pull request sat in the backlog for roughly two months. In many organizations, changes to CI/CD configuration are still reviewed as chores rather than as security fixes.

What to do now

  1. Check exposure first. Search lockfiles, artifact stores, container images and CI caches for the five versions, including transitive references. Pin the last safe versions, regenerate lockfiles created on 14 July and purge shared npm and Yarn caches. If any build, test or service imported an affected version, look for sync.js in “NodeJS” folders and stray background Node processes, and rotate every credential on that host from a clean machine.
  2. Audit every pull_request_target workflow. Never check out, install or build pull-request code in a privileged context. Run untrusted builds under the pull_request trigger and, if a privileged follow-up step is needed, use a separate workflow_run job that treats the uploaded results as untrusted data. Gating on a maintainer label is only a stopgap.
  3. Shrink tokens and bots. Set the default GITHUB_TOKEN to read-only and grant permissions per job. Replace organization-wide personal access tokens with repository-scoped GitHub Apps or fine-grained tokens, and keep secrets out of preview and test jobs.
  4. Put a gate in front of publishing. Apply branch protection or rulesets to administrators and bots as well, block force-pushes on release branches, and run publish jobs in a protected GitHub environment with required reviewers. npm’s trusted publisher settings can be tied to a specific workflow file and environment.
  5. Pin third-party actions to full commit SHAs and review updates deliberately. A tag can be moved; a commit hash cannot.
  6. Add a cooldown for new versions. Commit lockfiles and install with npm ci. npm 11.10.0, released in February 2026, adds a min-release-age setting that refuses versions younger than a set number of days, and dependency bots such as Renovate and Dependabot offer similar delays. These versions were live for about four hours, so even a one-day delay would have kept them out of any build that enforced it.
  7. Watch behavior, not only metadata. Restrict outbound traffic from CI runners and build hosts, block public IPFS gateways if the business does not need them, and alert on unexpected network connections during builds and tests. Keep verifying provenance, but treat it as one signal among several.
  8. Give CI/CD security fixes a deadline. Track workflow hardening like any other vulnerability, with an owner and a target resolution time. AsyncAPI has committed to zero-day priority SLAs for fixes like PR #2092.

Era Artech’s perspective

The AsyncAPI maintainers responded quickly and published a candid account, which lets the wider industry learn from it. The takeaway is that signed and attested releases are only as trustworthy as the pipelines and permissions that produce them. We encourage teams in Vietnam that publish packages or depend heavily on npm to review their GitHub Actions workflows with the same care they give to application code.

Sources

  1. Miasma Supply Chain Attack on AsyncAPI via Compromised CI/CD Pipelines AsyncAPI Initiative ·
  2. Unpacking the AsyncAPI npm supply chain compromise and import-time payload delivery Microsoft Security Blog ·
  3. Coordinated AsyncAPI Supply Chain Attack: Miasma RAT Delivered via Compromised CI/CD Pipelines in Two Repositories StepSecurity ·
  4. AsyncAPI npm packages infected with credential-stealing malware BleepingComputer ·
  5. Keeping your GitHub Actions and workflows secure Part 1: Preventing pwn requests GitHub Security Lab ·
  6. Release v11.10.0 npm (GitHub) ·

This analysis reflects information that was publicly available on its publication date. It is provided for general information only and is not legal or professional advice.

Need help assessing your exposure?

Our team can review your systems against the issues discussed here and help you prioritize fixes.

Talk to our security team