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.1carries the malicious loader and payload.org.mvnpm:posthog-node:4.18.0was 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.jsin the artifact, run as a preinstall script in the npm form. - File
bun_environment.js, SHA-1d60ec97eea19fffb4809bc35b91033b52490ca11as listed by Socket. - Environment variable
POSTINSTALL_BG=1on 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
- Remove org.mvnpm:posthog-node 4.18.1 and pin 4.18.0 or a later clean release.
- Delete the cached artifact and any node_modules folders on affected machines.
- If 4.18.1 appears, rotate GitHub, npm and cloud keys that the build machine can reach.
- 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
Send this page to the person who looks after AI at your company.