npm package report

Is @nx/js safe?

Versions 20.9.0 and 21.5.0 of @nx/js were compromised. Other versions are not flagged as malicious.

Do not install @nx/js 20.9.0 or 21.5.0

CRITICAL

Compromised releases. Added to CyberXYZ 2025-08-27, OSV malicious-package feed (Google / OpenSSF).

// what we observed

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. Immediate Actions Required For all users, check if you were impacted 1. Check your account's audit logs (https://github.com/settings/security-log?q=action%3Arepo.create) to see if a repo containing s1ngularity-repository in the name was published to your Github account. If so your credentials were likely compromised. Unfortunately, Github may have proactively deleted the repo for you. To be safe, rotate any credentials such as Github, NPM, and anything that may have been in your environment variables. 2. Check your local machine to see if there is a file at /tmp/inventory.txt, this file will contain a list of files which the malware probably read from. If this file exists, you have been affected. 3. Check this https://github.com/[GithubSlug]?tab=repositories&q=s1ngularity-repository to see if you have a repo containing s1ngularity-repository remains on your Github account. If you do not have the repository available to you anymore, reach out to Github support and they can provide you the contents of the repository. 4. Download the file in the repo for your own records. 5. Then, remove the repo from GitHub. 6. E-mail security@nrwl.io and we will instruct you on how to decode the file so you are aware what information was leaked 7. Rotate your credentials and tokens on all of your accounts. Rotate your Github token In order to rotate your Github token, follow these steps: 1. Visit https://github.com/settings/connections/applications/178c6fc778ccc68e1d6a. This is the setting for the Github app used by the gh CLI to authenticate itself. 2. Revoke access to that app. This will invalidate the OLD token which may have been compromised. 3. The next time you run the gh CLI, you will reauth and a NEW token will be generated. If you do not do this, your Github access token may be utilized to do malicious activity on your Github account. Rotate all of your tokens but this is specific instruction for Github to make it as easy as possible. For all users, stop using the malicious versions For Users Who were compromised: Refer to the section above to see if you were compromised. If so, do the following. • Rotate npm tokens: Visit https://www.npmjs.com/ and rotate your tokens. • Rotate Github Tokens: Visit https://www.github.com/ and rotate your tokens. • Change Github Credentials: Change passwords for Github • Change your passwords for any other services you use. • Check your .zshrc and .bashrc files for any unfamiliar lines and remove them. Purge Malicious Versions from Internal Registries For maintainers of internal registries Immediately remove the compromised versions listed above from your internal package registries (e.g., JFrog Artifactory, Sonatype Nexus) or any other proxies to npmjs.org. This will prevent further internal downloads of the malicious code. Affected Versions of nx • 21.5.0 • Published at 6:32 PM • 20.9.0 • 20.10.0 • 21.6.0 • 20.11.0 • 21.7.0 • 21.8.0 • 20.12.0 • Published at 8:37 PM 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 • 21.5.0 • Published at 6:32 PM • 20.9.0 • Published at 8:42 PM Affected Versions of @nx/eslint • 21.5.0 • Published at 6:32 PM These versions have since been removed from NPM as of 10:44 PM EDT Affected Versions of @nx/key and @nx/enterprise-cloud • 3.2.0 only • Published at 6:32 PM These versions have since been removed from NPM as of 6:20 AM EDT Attack Vector Vulnerable Workflow The root cause the introduction of a vulnerable workflow which contained the possibility for injecting executable code. The vulnerable workflow was reverted in master almost immediately after the team learned it could have been malicious. However, this proved to be inadequate to address the vulnerability. The workflow contained the 2 issues. Bash Injection The intention of these lines was to print out the pull request titles being validated via our commit format checks. However, if a PR was opened with a title such as $(echo "You've been compromised") the code would be executed within the workflow. We understood this once it was reported but we did not fully understand how this would compromise any secrets because the PR title validation workflow itself did not have access to any secrets. Elevated Permissions via pull_request_target The pull_request_target trigger (Github Docs) was used as a way to trigger the action to run whenever a PR was created or modified. However, what was missed is the warning that this trigger, unlike the standard pull_request trigger, runs workflows with elevated permissions including a GITHUB_TOKEN which has read/write repository permission. Furthermore, the workflows are executed on the target repo of the PR (nrwl/nx) which means that the GITHUB_TOKEN had permissions for the nrwl/nx repo. In addition, the workflow is run using the version of the workflow available on the target branch which is not necessarily master. We believe that the PR was made targeting an outdated branch which still contained the vulnerable workflow despite the fact that the vulnerable workflow was removed from master. > Note: While the GITHUB_TOKEN had read/write capabilities. The master branch and other important branches have Branch Protection rules enabled so the vulnerable workflow could not have written directly to master. We believe the GITHUB_TOKEN from this workflow was utilized to trigger another workflow, the publish.yml workflow. How the NPM token was compromised Up until this point, the team believed that although the PR validation workflow was vulnerable, it didn't contain any secrets. The vulnerable pipeline was just a means to trigger our publish.yml pipeline which does indeed have the npm token which was used to publish the malicious versions of Nx. The publish.yml pipeline, is our most permissive pipeline. It is responsible for publishing the Nx packages and therefore has access to the npm token via a Github Secret. As such, we took great care at least within the pipeline itself that ONLY our team was able to utilize the pipeline. As recommended, our github secrets are only accessible within pipelines triggered on nrwl/nx and they are not accessible from any forks keeping it safe from external contributors. However, because of the elevated permissions from the PR validation workflow, the publish.yml workflow was triggered to run on the nrwl/nx repo. Additional changes were made in the malicious commit which altered the behavior of the publish.yml pipeline to send the npm token to a webhook. As part of the bash injection, the PR validation workflows triggered a run of the publish.yml with this malicious commit and sent our npm token to an unfamiliar webhook. We believe this is how the user got a hold of the NPM token used to publish the malicious versions of Nx. Note: The publish.yml workflow did not publish packages in this incident but was the means to obtain the NPM token. 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. The Github repo would be posted with a name which contains s1ngularity-repository. Github has since started to deactivate or archive these repos on their end. If you see that you have this repo, even though it may be archived now, at one point it was likely public meaning credentials in there could have been compromised. Modification to $HOME/.zshrc and $HOME/.bashrc The malicious postinstall script also modified the .zshrc and .bashrc which are run whenever a …

Reported by GitHub Advisory Database and Google Open Source Security via OSV.

// versions and what to do
Malicious
20.9.0, 21.5.0
Move to
21.6.11 newest 21.x release, no known advisory
20.8.4 newest 20.x release, no known advisory

If one of these versions was installed, remove it and treat the credentials, tokens and SSH keys on that machine as exposed: rotate them. Check CI runners and container images that installed it too.

npm install @nx/js@21.6.11

OSV recordadvisoryissueissuepull requestfix commitreferencereferenceadvisoryadvisory

// reach

29 direct dependencies

4 carry known advisories, worst HIGH

36 packages depend on it

an advisory here reaches each of them

Create a free accountfor every dependency path, dependent and what to upgrade
// ai model usage

Tracked for PyPI packages. HuggingFace models declare Python dependencies, so npm packages are not covered.



Checked 2026-10-31 at 00:02 UTC. Updated continuously from NVD, GHSA, OSV and CNA feeds.

Think a verdict here is wrong? Tell us — we respond within 2 business days.