CVE-2025-59142
Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.
NVD · uneditedcolor-string is a parser and generator for CSS color strings. On 8 September 2025, the npm publishing account for color-string was taken over after a phishing attack. Version 2.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. 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 issue has been resolved in 2.1.2.
Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.
dbcve analysis · high confidenceThe color-string npm package (version 2.1.1) was compromised through a compromised publisher account. The malicious version added code targeting browser environments to redirect cryptocurrency transactions (particularly MetaMask) to the attacker's addresses. Only applications running in browser contexts are affected; server-side Node.js applications, CLI tools, and local environments are not impacted.
Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.
CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.
From the vector- Attack vector
- Network
- Complexity
- Low
- Privileges
- None
- Authentication
- X
- User interaction
- None
- Scope
- X
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/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:Red
Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.
dbcve checksWork through these to decide whether this CVE applies to you.
-
Identify color-string installationRun 'npm list color-string' or check package.json dependencies to see if color-string is listed and which version is installedAffected if Version 2.1.1 is installed
-
Verify browser context usageInspect your build configuration (webpack.config.js, vite.config.js, rollup.config.js, etc.) and determine if the application bundle includes color-string for browser deliveryAffected if The package is bundled and served to browser clients (not limited to server-side Node.js)
-
Inspect package contents for malicious redirect codeNavigate to node_modules/color-string/dist/ or the main entry point and search for patterns like 'MetaMask', '0x', 'ethereum', 'sendTransaction', or string manipulation targeting wallet addressesAffected if Code contains crypto transaction redirection logic or wallet address replacement patterns
-
Check for version 2.1.2 or later in lockfileReview package-lock.json or yarn.lock to confirm the resolved version of color-string across all dependency treesAffected if Lockfile resolves to version 2.1.1 specifically
If color-string version 2.1.1 is present in a browser-bundled application, the malicious crypto-redirect code may execute in user browsers.
Generated from the published advisory. Verify against your own configuration.
Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.
dbcve · scopedUpdate color-string to version 2.1.2 or later, then rebuild all browser bundles that included the package to ensure the compromised version is not present. Clear any cached copies from private registries.
color-string version 2.1.2 or later
- Check your project's dependencies to see if color-string version 2.1.1 is in use (look in package.json, package-lock.json, or yarn.lock)
- Run 'npm update color-string' or 'yarn upgrade color-string' to upgrade to the latest version
- Verify that color-string is now at version 2.1.2 or later by running 'npm list color-string' or 'yarn list color-string'
- If you use a private npm registry, clear any cached versions of the malicious package
- If color-string was used in browser contexts, rebuild your application bundles (re-run your build process with Babel, Rollup, Vite, Next.js, or your bundler of choice) to ensure the malware is not included
- Audit your application for any signs of the malicious behavior (redirects to cryptocurrency wallet addresses targeting MetaMask)
Generated from the published advisory — verify against the referenced sources before acting.
- Consultation2.0 h
- Implementation4.0 h
- Testing3.0 h
- Review / QA2.0 h
An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $3,088.
Scan for this in your stack
Free · runs locallyCheck whether your project pulls in CVE-2025-59142 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.
References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.
Primary sourcesPractitioner notes
ContributedPeer-ranked notes from engineers who’ve handled CVE-2025-59142 in production — separate from our analysis above.
The advisory tells you what broke. It rarely tells you what actually worked. If you’ve dealt with this one, that detail is what the next engineer is searching for.
- The version that genuinely resolved it — not the one the vendor claimed
- A config change or rule that shut the vector down
- A gotcha in the upgrade path that cost you an afternoon
No notes yet
Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.
A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.
- Verified mitigations, workarounds, and config changes
- Version or environment caveats, and links to real fixes
- No weaponised exploit code, or anything meant to cause harm
- No spam, self-promotion, credentials, or personal data