Summary
Malicious versions of the nx package, as well as some supporting plugin packages, were published to npm, containing code that scans the file system, collects credentials, and posts them to GitHub as a repo under user's accounts.
Affected Versions of nx
- 21.5.0
- 20.9.0
- 20.10.0
- 21.6.0
- 20.11.0
- 21.7.0
- 21.8.0
- 20.12.0
These versions have since been removed from NPM as of 10:44 PM EDT
Affected Versions of @nx/devkit, @nx/js, @nx/workspace, @nx/node
Affected Versions of @nx/eslint
These versions have since been removed from NPM as of 10:44 PM EDT
Affected Versions of @nx/key and @nx/enterprise-cloud
These versions have since been removed from NPM as of 6:20 AM EDT
Attack Vector
At this time, we believe an npm token was compromised which had publish rights to the affected packages.
Malicious Behavior
Credentials published as a GitHub repo
The compromised package contained a postinstall script that scanned user's file system for text files, collected paths, and credentials upon installing the package. This information was then posted as an encoded string to a GitHub repo under the user's GitHub account.
<img width="1275" height="998" alt="Image" src="https://github.com/user-attachments/assets/ce664a97-dbdf-4200-a9a4-dd19f0cb5bc5" />