CVE-2025-59140: backslash@0.2.1 contains malware after npm account takeover
Impact On 8 September 2025, the npm publishing account for backslash was taken over after a phishing attack. Version 0.2.1 was published, functionally identical to the previous patch version, but with a malware payload added attempting to redirect cryptocurrency transactions to the attacker's own addresses from within browser environments.
Local environments, server environments, command line applications, etc. are not affected. If the package was used in a browser context (e.g. a direct <script> inclusion, or via a bundling tool such as Babel, Rollup, Vite, Next.js, etc.) there is a chance the malware still exists and such bundles will need to be rebuilt.
The malware seemingly only targets cryptocurrency transactions and wallets such as MetaMask. See references below for more information on the payload.
Patches npm removed the offending package from the registry over the course of the day on 8 September, preventing further downloads from npm proper.
On 13 September, the package owner published new patch versions to help cache-bust those using private registries who might still have the compromised version cached. This version is functionally identical to the previously known-good version, published as a patch version bump above the compromised version.
Users should upgrade to the latest patch version, completely remove their nodemodules directory, clean their package manager's global cache, and rebuild any browser bundles from scratch.
Those operating private registries or registry mirrors should purge the offending versions from any caches.
References - https://www.aikido.dev/blog/npm-debug-and-chalk-packages-compromised - https://socket.dev/blog/npm-author-qix-compromised-in-major-supply-chain-attack - https://www.ox.security/blog/npm-packages-compromised/
Point of Contact In the event suspicious behavior is still observed for the package listed in this security advisory after performing all of the above cleaning operations (see Patches above), please reach out via one of the following channels of communication:
- Bluesky, package owner: https://bsky.app/profile/bad-at-computer.bsky.social - debug repository, tracking issue (applies to all packages affected in the breach): https://github.com/debug-js/debug/issues/1005
Other sources
backlash parses collected strings with escapes. On 8 September 2025, the npm publishing account for backslash was taken over after a phishing attack. Version 0.2.1 was published, functionally identical to the previous patch version, but with a malware payload added attempting to redirect cryptocurrency transactions to the attacker's own addresses from within browser environments. Local environments, server environments, command line applications, etc. are not affected. If the package was used in a browser context (e.g. a direct <script> inclusion, or via a bundling tool such as Babel, Rollup, Vite, Next.js, etc.) there is a chance the malware still exists and such bundles will need to be rebuilt. The malware seemingly only targets cryptocurrency transactions and wallets such as MetaMask. npm removed the offending package from the registry over the course of the day on 8 September, preventing further downloads from npm proper. On 13 September, the package owner published new patch versions to help cache-bust those using private registries who might still have the compromised version cached. Users should upgrade to the latest patch version, completely remove their nodemodules directory, clean their package manager's global cache, and rebuild any browser bundles from scratch. Those operating private registries or registry mirrors should purge the offending versions from any caches. This issues is resolved in 0.2.2.
— MITRE
Affected Software
Event History
Frequently Asked Questions
What is the severity of CVE-2025-59140?
CVE-2025-59140 is classified as a high severity vulnerability due to the potential malware payload distributed.
How do I fix CVE-2025-59140?
To fix CVE-2025-59140, you should remove any versions of the 'backslash' package published after September 8, 2025, and reinstall a safe version from a trusted source.
What are the risks associated with CVE-2025-59140?
The risks associated with CVE-2025-59140 include unauthorized access, data theft, and system compromise due to the malware payload.
Which versions of 'backslash' are affected by CVE-2025-59140?
All versions of the 'backslash' package published after September 8, 2025, are affected by CVE-2025-59140.
What should I do if I've installed the affected version from CVE-2025-59140?
If you've installed the affected version, immediately uninstall it and scan your systems for any potential malware activity.