Skip to main content

AsyncAPI: Trojaned npm Packages With Valid Provenance

· 10 min read
Ankush K
Co-founder and CTO, Dwaar
AsyncAPI: Trojaned npm Packages With Valid Provenance

If your npm policy comes down to "require provenance and block install scripts", the AsyncAPI compromise got past both. On 2026-07-14, five malicious versions across four @asyncapi packages reached npm with valid OIDC provenance and no install script, because the project's own release workflow published them.

At a glance
IdentifierNo CVE. No project-issued GHSA as of 2026-07-16 (one per package is on the project's to-do list). GitHub added generator 3.3.1, generator-helpers 1.1.1 and specs 6.11.2 to its existing malware advisories (GHSA-9658-p648-rc4q, GHSA-gw3q-hxvp-x7vm, GHSA-5jj9-3vg7-7785) on 2026-07-14. generator-components 0.7.1 and specs 6.11.2-alpha.1 are not listed there, so do not rely on advisory scans alone.
Affected@asyncapi/generator 3.3.1, @asyncapi/generator-helpers 1.1.1, @asyncapi/generator-components 0.7.1, @asyncapi/specs 6.11.2-alpha.1 and 6.11.2
Fixed inAll five were unpublished later on 2026-07-14. Last clean: 3.3.0, 1.1.0, 0.7.0, 6.11.1. I found no confirmed new patch release.
SeverityNo CVSS score from anyone. GitHub's malware advisories carry a critical label without one.
Exploited as of 2026-07-16Yes. Live on npm for several hours. Victim count is not public. No CVE, so no CISA KEV entry.
Disclosed2026-07-14, in asyncapi/generator issue #2184

From a docs preview to an npm release​

A preview workflow ran fork content with secrets. manual-netlify-preview.yml triggers on pull_request_target for apps/generator/docs/** and checks out the contributor's commit with ref: ${{ github.event.pull_request.head.sha }}. It copies the PR's markdown into a checkout of asyncapi/website, runs npm ci and a Netlify build, and passes secrets.GH_TOKEN and secrets.NETLIFY_AUTH_TOKEN.

Markdown is the likely way in. Microsoft says the MDX submitted in PR #2155 contained code designed to retrieve JavaScript from rentry[.]co. The maintainer who wrote the workflow said he had judged copying markdown safe, and after reading a researcher's analysis wrote "so looks like mdx that is used in website repo is not sanitizing what is in markdown and invokes IIFE". Microsoft notes the public log does not show whether that request succeeded or whether a credential was stolen.

The token was reportedly broad. Microsoft says the workflow exposed the asyncapi-bot personal access token, and that later push records show asyncapi-bot as the authenticated actor. A maintainer calls GH_TOKEN the "bot's classical token", and the issue reporter describes it as an org-level PAT, while saying he cannot confirm it was the credential used. Treat this as reported, not settled. Another maintainer suspects that day's flood of spam PRs was cover.

The branch was open. At 06:58:42 UTC, commit 3eab3ec9 landed on next under the placeholder identity Your Name, you@example.com. next had no branch protection, so one token with contents: write was enough.

The release pipeline did the rest. The push triggered the release workflow, and at 07:10 UTC the three generator packages went out through GitHub Actions OIDC. Researchers quoted by The Hacker News say no npm token was stolen. None was needed. @asyncapi/specs followed from asyncapi/spec-json-schemas at 08:06 and 08:30 UTC. That repo's issue names the alpha branch, while a checklist in the generator thread says attacker commit 689f5b9669 was still the HEAD of master on 2026-07-15. Assume both were touched.

The project had the warning. PR #2078, "docs: pwn in docs preview poc", opened on 2026-04-29. PR #2092, opened on 2026-05-17, said the workflow "satisfied most of the requirements of a pwn_request" and split it in two. It sat unmerged for about eight weeks before the attack. A hardening PR on a workflow holding a bot's classic token is a security fix. Treat it as one.

The payload runs on import​

In the generator packages the code was injected into library source (validator.js, utils.js and ErrorHandling.js) as an obfuscated, whitespace-padded line of about 7.7 KB. In @asyncapi/specs it was prepended to index.js. It fires when the module is loaded, so --ignore-scripts does nothing here. It starts a detached node process, which pulls an 8.25 MB sync.js from IPFS into a hidden NodeJS directory and runs it.

Sources disagree on what happens next. The issue reporter describes a remote access trojan aimed at browser profiles, SSH keys, ~/.npmrc, AWS credentials, the macOS Keychain and crypto wallets. Microsoft reports that data-collection modules were disabled in this build but persistence and C2 were active. Plan for the reporter's version.

Attribution is open too. The Hacker News describes a loader that fetches Miasma, but the reporter says he "cannot confirm this is the same actor", and researchers quoted there say it is not attributed to the earlier campaigns. Your response does not change either way.

What to check and do now​

  1. Search lockfiles, transitive resolutions included, and CI caches for the five versions. Pin exact numbers, not dist-tags: generator 3.3.0, generator-helpers 1.1.0, generator-components 0.7.0, specs 6.11.1.
  2. On any laptop or runner that could have loaded them from 07:10 UTC on 2026-07-14, look for sync.js in ~/.local/share/NodeJS/, ~/Library/Application Support/NodeJS/ or %LOCALAPPDATA%\NodeJS\, and for orphaned node processes started from there.
  3. Check egress logs for 85.137.53.71 on ports 8080, 8081 and 8091, and for ipfs.io requests for CID QmQobZSp1wRPrpSEQ56qnyq7ecZh5Bg5k1fnjt4SUwwHb9 (generator packages) or Qmet4fhsAaWMBUxNDfREHwgiyDeSWy4YSYs9wiKUW5jGyf (@asyncapi/specs). Block the IP.
  4. If the module loaded, isolate the host and remove the implant before you revoke anything. The Hacker News reports a dead man's switch that wipes a directory when a stolen token is revoked, and also that it was toggled off in this build, though Microsoft warns disabled modules could be enabled through persistence. Microsoft does not mention the switch by name. Do the cleanup first, and keep it quick, because stolen credentials stay live until you rotate them. Delete sync.js, kill those processes, and check for persistence: the miasma-monitor HKCU Run value on Windows, miasma-monitor.service as a systemd user unit on Linux, and injected lines in .zshrc, .bashrc and .bash_profile on macOS. The Hacker News also lists crontab and launchd autostart entries. Microsoft recommends rebuilding affected projects, shared base images and build runners from a known-good baseline. I would rebuild the host too. Then rotate npm, GitHub, SSH and AWS credentials from a clean host, and treat browser-saved passwords as compromised. An install that never loaded the module is clean only if you can show it.
  5. Purge npm and Yarn caches. Microsoft also recommends npm CLI 11.10.0 or later, or the min-release-age setting. Take it: these versions were gone the same day.
  6. If you use @asyncapi/react-component, audit it. Generator commit 3eab3ec9 also changed apps/react-sdk/src/utils/withNewLines.ts. No matching npm package appears to have been published, but the reporter asks for that scope to be checked.

Provenance answered the question it was asked​

Provenance did its job. It proved, in the words researchers gave The Hacker News, "only that the project's authorized workflow produced them, not that the triggering commits were legitimate". Attestation proves the pipeline ran, not that the pipeline was safe. If a green provenance check is your whole policy, you have handed the release decision to anyone who can push to that branch.

Keep trusted publishing: getting rid of long-lived npm tokens is still right. But it moves the trust boundary to the branch and the workflow, which is why your CI pipeline is production. TanStack took cache poisoning and OIDC theft. AsyncAPI took a push.

If you publish packages, start from the hardening list in the issue:

  • Split pull_request_target workflows so untrusted content never runs with secrets, as PR #2092 does. If your site renders MDX, markdown is untrusted code.
  • Protect every release branch and block direct pushes, bots included.
  • Bind the npm trusted publisher to one workflow file and a GitHub environment, then limit that environment's deployment branches and tags to protected refs and require reviewers.
  • Replace shared bot PATs with a GitHub App and short-lived tokens.
  • Alert on releases from an unintended ref. Provenance records it, for example refs/heads/next.

Try this on your own org​

Take the package you publish with the most consumers. Open the provenance of its latest release and read the ref and workflow it names. Then list every person, bot and token that can push to that ref today, and check whether any pull_request_target workflow can reach those tokens. That list is your real release policy.

References​