Malicious Nx npm Releases and Packagist Packages Trigger Supply-Chain Malware
Supply Chain Risk · 3 sources · Updated 5mo ago · First seen May 25, 2026

Attackers poisoned multiple open-source packages in separate supply-chain incidents, including malicious nx and related @nx npm releases and eight compromised Packagist packages. Nrwl said the Nx compromise began after attackers exploited a vulnerable pull_request_target GitHub Actions workflow in the nrwl/nx repository, stole an npm publishing token, and pushed tainted versions that ran a postinstall script. The malware searched local file systems, collected credentials and path data, exfiltrated information by creating GitHub repositories containing s1ngularity-repository in victims’ accounts, and altered shell startup files such as .zshrc and .bashrc to add a shutdown command that could prompt for a system password. Affected Nx versions included 20.9.0 through 20.12.0 and 21.5.0 through 21.8.0, while some Nx Console VSCode users were also exposed because versions 18.6.30 through 18.65.1 automatically installed nx@latest.
A separate campaign hit Packagist by hiding malicious logic in package.json instead of composer.json, targeting PHP projects that also invoke JavaScript tooling during install or build steps. Socket reported that the packages attempted to fetch a Linux binary from GitHub Releases, save it as /tmp/.sshd, mark it executable, and launch it in the background, creating a remote-code-execution path during dependency installation while suppressing errors and disabling TLS verification. The compromised versions were removed from Packagist, and the Nx packages were removed from npm after disclosure, but both incidents underscored how attackers are abusing CI/CD workflows and cross-ecosystem package metadata to distribute malware, steal credentials, and evade defenders focused on a single package manager.
Why it matters
Impact assessment
Multiple software supply-chain compromises affected developers, CI/CD systems, and end-user workstations that installed tainted Nx npm packages or the compromised Packagist packages. Impact is high because both incidents enabled code execution during dependency installation, with the Nx campaign additionally stealing credentials, modifying shell startup files, and exfiltrating data through victim-owned GitHub repositories.
Business impact
- Affected populations:
- JavaScript/TypeScript development teams using
nxor related@nxpackages - VSCode users running Nx Console versions
18.6.30through18.65.1 - PHP development teams using the compromised Packagist packages and invoking JavaScript tooling during install/build
- CI/CD runners and build agents that automatically install dependencies
- JavaScript/TypeScript development teams using
- Severity:
- Credential theft from local files and environment variables
- Remote code execution during package installation/build workflows
- Potential operational disruption from shell persistence changes and shutdown command insertion
- Reputational and financial risk from compromised developer accounts, package registries, and downstream software artifacts
- Scope:
- Nx exposure was broad because malicious versions were published to npm and could be installed directly, transitively, or via tooling such as editors/extensions
- Packagist exposure was more targeted to PHP projects that also process
package.jsonor run JavaScript build steps
- Exploitation in the wild:
- Yes. Both stories describe active malicious package publication and execution paths used against real users
- GitHub reportedly began deactivating or archiving malicious repositories created under victims’ accounts in the Nx incident


