CVE-2025-59140
Unknown Unknown - Not Provided
BaseFortify

Publication date: 2025-09-15

Last updated on: 2025-09-16

Assigner: GitHub, Inc.

Description
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 node_modules 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.
CVSS Scores
EPSS Scores
Probability:
Percentile:
Meta Information
Published
2025-09-15
Last Modified
2025-09-16
Generated
2026-05-07
AI Q&A
2025-09-15
EPSS Evaluated
2026-05-05
NVD
EUVD
Affected Vendors & Products
Showing 3 associated CPEs
Vendor Product Version / Range
npm backslash 0.2.1
npm backslash 0.2.2
metamask metamask *
Helpful Resources
Exploitability
CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-506 The product contains code that appears to be malicious in nature.
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?

CVE-2025-59140 is a vulnerability in the npm package 'backslash' where the package's publishing account was taken over via a phishing attack. The attacker published a malicious version (0.2.1) that included malware designed to redirect cryptocurrency transactions to the attacker's addresses, but only when the package is used in browser environments. Local, server, and command-line environments are not affected. The malware targets cryptocurrency wallets such as MetaMask. The compromised package was removed from npm, and a patched version (0.2.2) was released to fix the issue. [1]


How can this vulnerability impact me? :

If you use the 'backslash' package in a browser context (such as via direct script inclusion or bundling tools like Babel, Rollup, Vite, Next.js), this vulnerability can lead to malware redirecting your cryptocurrency transactions to the attacker's addresses, potentially causing financial loss. Local, server, and command-line uses are not affected. To mitigate the risk, users should upgrade to version 0.2.2, remove node_modules directories, clear package manager caches, and rebuild browser bundles. [1]


How can this vulnerability be detected on my network or system? Can you suggest some commands?

This vulnerability can be detected by checking if the compromised version 0.2.1 of the 'backslash' npm package is present in your browser bundles or node_modules directories. Since the malware only activates in browser environments, inspect your bundled JavaScript files for references to version 0.2.1 or suspicious code redirecting cryptocurrency transactions. You can use commands like 'npm list backslash' to check installed versions, and search your bundled files with 'grep -r "[email protected]" ./dist' or similar. Additionally, verify your package-lock.json or yarn.lock files for the compromised version. There are no specific commands provided in the resources, but these general npm and file search commands can help detect the presence of the vulnerable package. [1]


What immediate steps should I take to mitigate this vulnerability?

Immediate mitigation steps include upgrading the 'backslash' package to version 0.2.2, which contains the fix. You should completely remove your node_modules directory, clear your package manager's global cache (e.g., 'npm cache clean --force'), and rebuild any browser bundles from scratch to ensure the malicious code is removed. If you operate private registries or mirrors, purge any cached compromised versions of the package. These steps will help eliminate the malware payload and prevent further exploitation. [1]


Ask Our AI Assistant
Need more information? Ask your question to get an AI reply (Powered by our expertise)
0/70
EPSS Chart