CWE-506Weakness · CWE-506

CVE-2025-59142

HIGH · 8.8 CVSS v4.0 Published 2025-09-15
Mitigation only
No fix yet — a mitigation exists. There is no fixed release. A documented workaround reduces exposure in the meantime.
See remediation →
97/100
Remediation priority · Urgent
Remotely reachable No privileges Zero-click

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 · unedited
color-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 confidence

The 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.

MitigationUpdate 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.

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 checks

Work through these to decide whether this CVE applies to you.

  1. Identify color-string installation
    Run 'npm list color-string' or check package.json dependencies to see if color-string is listed and which version is installed
    Affected if Version 2.1.1 is installed
  2. Verify browser context usage
    Inspect your build configuration (webpack.config.js, vite.config.js, rollup.config.js, etc.) and determine if the application bundle includes color-string for browser delivery
    Affected if The package is bundled and served to browser clients (not limited to server-side Node.js)
  3. Inspect package contents for malicious redirect code
    Navigate 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 addresses
    Affected if Code contains crypto transaction redirection logic or wallet address replacement patterns
  4. Check for version 2.1.2 or later in lockfile
    Review package-lock.json or yarn.lock to confirm the resolved version of color-string across all dependency trees
    Affected 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.

Check your environment

Paste your version and any relevant configuration and it will be compared against the affected criteria above. Do not include secrets or credentials.

AI-assisted, checked against the advisory. Informational, not a guarantee.

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 · scoped
Mitigation available No clean upgrade yet — mitigate in the meantime
Mitigation

Update 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.

Recommended fix High confidence

color-string version 2.1.2 or later

  1. 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)
  2. Run 'npm update color-string' or 'yarn upgrade color-string' to upgrade to the latest version
  3. Verify that color-string is now at version 2.1.2 or later by running 'npm list color-string' or 'yarn list color-string'
  4. If you use a private npm registry, clear any cached versions of the malicious package
  5. 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
  6. Audit your application for any signs of the malicious behavior (redirects to cryptocurrency wallet addresses targeting MetaMask)
Caveat The fix version (2.1.2) is functionally identical to prior legitimate versions; no breaking changes expected

Generated from the published advisory — verify against the referenced sources before acting.

Have this fixed Scoped from the published advisory
  • Consultation2.0 h
  • Implementation4.0 h
  • Testing3.0 h
  • Review / QA2.0 h
11.0 hours of engineering $1,930
Get help mitigating

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 locally
dbcve dependency scanner

Check 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 sources

Practitioner notes

Contributed

Peer-ranked notes from engineers who’ve handled CVE-2025-59142 in production — separate from our analysis above.

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.

What this is

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.

What belongs here
  • 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