# CVE-2025-59162: color-convert@3.1.1 contains malware after npm account takeover

> Attackers injected malware into a popular JavaScript library to hijack cryptocurrency transactions in browser environments, requiring users to rebuild bundles.

- **Severity:** High 8.8 (`CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:H/VA:N/SC:N/SI:N/SA:N/E:A/U:Red`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 15 Sep 2025
- **Updated:** 15 Sep 2025

## What is CVE-2025-59162?

CVE-2025-59162 is a high-severity vulnerability in Qix- color-convert, published on 15 Sep 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

color-convert provides plain color conversion functions in JavaScript. On 8 September 2025, the npm publishing account for color-convert was taken over after a phishing attack. Version 3.1.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 update 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 issue is resolved in 3.1.2.

Weakness: CWE-506 (Embedded Malicious Code)

## Which versions are affected by CVE-2025-59162?


## How do I fix CVE-2025-59162?

Upgrade to a fixed version.

## Is CVE-2025-59162 being exploited?

There is no known exploitation of CVE-2025-59162 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-59162 and fix it if it is affected.

What it is: CVE-2025-59162 is a high-severity vulnerability in Qix- color-convert, published on 15 Sep 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2025-59162 in the wild and no public exploit code.

Affected product: Qix- color-convert. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2025-59162/ (Markdown: https://insights.sbomify.com/CVE-2025-59162/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2025-59162
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2025-59162
- OSV: https://osv.dev/vulnerability/CVE-2025-59162

---
From sbomify Insights: https://insights.sbomify.com/CVE-2025-59162/
Summaries are generated and may contain mistakes; the official description above is the record.
