Maven

The Shai-Hulud v2 Maven Central Supply Chain Attack

Updated 18 Nov 2026 · Incident date 24 Nov 2025

org.mvnpm:posthog-node 4.18.1 on Maven carried the Shai-Hulud v2 worm as an automatic copy of a compromised npm package on 24 November 2025.

PostHog did not publish it. Maven Central purged the mirrored copies on 25 November 2025.

What happened

The mvnpm process rebuilt a poisoned npm package as a Maven artifact without manual review.

  • The artifact held setup_bun.js, a loader.
  • It also held bun_environment.js, a heavily obfuscated payload of about 10 MB.
  • The loader downloads Bun and starts the payload in a detached background process with POSTINSTALL_BG=1.
  • The payload steals GitHub tokens, environment variables and AWS, GCP and Azure secrets.
  • With a valid npm token, it injects the files into other packages and republishes them.

The Hacker News reports 4.18.1 was the only Java package found with the worm.

Affected versions

  • org.mvnpm:posthog-node:4.18.1 carries the malicious loader and payload.
  • org.mvnpm:posthog-node:4.18.0 was the clean release before it.
  • A project that resolved 4.18.1 before 25 November 2025, 22:44 UTC still holds a bad copy in its local cache.

Indicators of compromise

  • File setup_bun.js in the artifact, run as a preinstall script in the npm form.
  • File bun_environment.js, SHA-1 d60ec97eea19fffb4809bc35b91033b52490ca11 as listed by Socket.
  • Environment variable POSTINSTALL_BG=1 on a detached background process.
  • A downloaded Bun runtime and a TruffleHog binary on a build machine.
  • A new GitHub repository in your account with a random name and the description Sha1-Hulud: The Second Coming.

How to check

Check your Maven manifests and saved dependency reports for the affected version. Run this in the project folder.

grep -n -C 4 'posthog-node' pom.xml

Look in the local Maven cache for the version directory.

ls ~/.m2/repository/org/mvnpm/posthog-node/

What to do now

  1. Remove org.mvnpm:posthog-node 4.18.1 and pin 4.18.0 or a later clean release.
  2. Delete the cached artifact and any node_modules folders on affected machines.
  3. If 4.18.1 appears, rotate GitHub, npm and cloud keys that the build machine can reach.
  4. Check GitHub for repositories described as Sha1-Hulud: The Second Coming.

Frequently asked questions

Did Shai-Hulud v2 reach Maven Central?

Yes. org.mvnpm:posthog-node:4.18.1 carried the loader and payload as an automatic rebuild of the npm package.

Did PostHog publish the bad Maven package?

No. The mvnpm process rebuilt the npm package as a Maven artifact.

Sources

  1. socket.dev/blog/shai-hulud-strikes-again-v2
  2. thehackernews.com/2025/11/shai-hulud-v2-campaign-spreads-from-npm.html
  3. wiz.io/blog/shai-hulud-2-0-aftermath-ongoing-supply-chain-attack

Send this page to the person who looks after AI at your company.

Email it

More supply chain attacks

All 172 attacks in the library · What is a supply chain attack? · How to prevent supply chain attacks

Check the next update before you install it

Vigilance compares the version you trust with the new one. It names the one file that gained a power the old version did not have.

Start the free 14-day trialBrowse the attack library