Skip to main content
Mallory
← Back to News
package-repository-poisoningbuild-pipeline-compromisecredential-stealer-activityloader-delivery-mechanism

Malicious Nx npm Releases and Packagist Packages Trigger Supply-Chain Malware

Supply Chain Risk · 3 sources · Updated 5mo ago · First seen May 25, 2026

Malicious Nx npm Releases and Packagist Packages Trigger Supply-Chain Malware

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 nx or related @nx packages
    • VSCode users running Nx Console versions 18.6.30 through 18.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
  • 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.json or 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
Does this reach your builds?Trace attribution and downstream blast radius.
Trace the chain
Event timeline

How this story unfolded

Events from the most recent confirmed update back to the earliest known activity.

7 events · Aug 26, 2025 – May 23, 2026
  1. May 23, 20266mo ago

    Compromised Packagist package versions are removed and broader reuse is reported

    Socket reported that the malicious Packagist versions were removed and warned that placing the payload in package.json could evade defenders focused only on Composer metadata. The same payload was also reportedly referenced across 777 GitHub files, including some GitHub Actions workflows, suggesting multiple execution paths.

  2. May 23, 20266mo ago

    Supply-chain attack compromises eight Packagist packages

    A coordinated attack inserted malicious code into package.json files of eight Packagist packages, targeting PHP projects that also use JavaScript build tooling. The postinstall logic attempted to download a Linux binary from GitHub Releases, save it as /tmp/.sshd, mark it executable, and run it in the background.

  3. Sep 3, 20251y ago

    Researchers report malicious Nx packages also impacted some VSCode Nx Console users

    Analysis of the incident noted that Nx Console versions 18.6.30 through 18.65.1 automatically installed nx@latest, which could trigger the malicious postinstall even in environments not otherwise using Nx directly. This expanded the understood exposure beyond standard npm consumers.

  4. Aug 27, 20251y ago

    Nrwl discloses the Nx supply-chain compromise and publishes remediation guidance

    Nrwl published a security advisory describing the malicious npm releases, the GitHub Actions workflow root cause, affected versions, and indicators of compromise. The company advised users to inspect GitHub audit logs and local systems, rotate GitHub and npm tokens and other credentials, clear caches, and remove compromised versions from internal registries.

  5. Aug 27, 20251y ago

    npm removes compromised Nx packages from the registry

    The malicious Nx and related package versions were removed from npm after the compromise was identified. Nrwl's advisory states the removals occurred on August 26-27, 2025.

  6. Aug 26, 20251y ago

    Malicious Nx and related @nx package versions are published to npm

    Unauthorized malicious versions of nx and related @nx packages were published to npm, including affected nx versions 20.9.0 through 20.12.0 and 21.5.0 through 21.8.0. The packages contained a postinstall script that scanned local files, collected credentials and path data, exfiltrated information by creating GitHub repositories under victims' accounts, and modified shell startup files to add a shutdown command.

  7. Aug 26, 20251y ago

    Attackers exploit nrwl/nx GitHub Actions workflow to steal npm publish token

    Attackers abused a bash injection flaw in a pull_request_target workflow with elevated permissions in the nrwl/nx repository, then triggered another workflow and stole an npm publishing token via a malicious commit and webhook. This compromise enabled unauthorized publication of malicious Nx packages to npm.

Linked entities

Related entities

Vulnerabilities, threat actors, malware, products, organizations, and breaches Mallory has linked to this story.

Open in app →

Organizations

2 linked
PackagistNrwl

Breaches

2 linked
GITHUBUSERSWHOINSTALLEDAFFECTEDNXPACKAGES-2025-08NRWL-2025-08
Do you run this?See attribution and downstream blast radius, and whether this package or vendor reaches your builds.
Trace the Supply Chain
Mallory platform

See the full picture, correlated to your attack surface.

This page covers what’s public. Mallory adds the parts that aren’t: which of your assets are affected, which threat actors are using it right now, and what to deploy next.

Exposure mappingMap indicators from this story to your assets and identify affected systems in minutes.
Threat actor evidenceEvery observed campaign, victim, and pivot linked to actors named in this story.
Associated malwareMalware, exploits, and IOCs connected to the activity described here.
Detection signaturesYARA, Sigma, and Snort rules deployed to your SIEM as soon as they’re published.
Scheduled alertsGet matching new stories delivered to your team as they break, not the next morning.
AI threadsAsk questions about this story and take action on the answers.