CVE-2025-3197: expand-object prototype pollution in expand() function

CVE-2025-3197 · Severity: low · CVSS 3.1 · Published 2025-04-04

expand-object is a Node.js library that converts strings into JavaScript objects. A prototype pollution vulnerability in its expand() function allows attackers to inject arbitrary properties into the base Object prototype without authentication or user interaction, potentially affecting all objects created in the application. This can lead to data tampering, denial of service, or in some cases remote code execution if the application evaluates polluted properties.

Vendors: npm.

Quick answers

Is CVE-2025-3197 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2025-3197 being exploited in the wild.
How severe is CVE-2025-3197?
Low severity, with a CVSS score of 3.1, published 4 April 2025.
Which products and versions are affected?
expand-object (npm) SEMVER:introduced=0,last_affected=0.4.2.
Is there a fix for CVE-2025-3197?
No fixed version is recorded yet. Check the vendor's advisory in the references below. If you run it, Junglewise drafts a mitigation that fits your setup and applies it once you approve, with senior security engineers behind it.
How is CVE-2025-3197 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2025-3197?
Check whether you run expand-object (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

Technical details

The vulnerability is a prototype pollution issue (CWE-1321) in the expand() function (index.js line 13) of expand-object versions 0.0.0 through 0.4.2. The function expands a string into an object by parsing property paths (e.g., "__proto__.polluted:value") without validating or filtering sensitive keys like __proto__, constructor, or prototype. An unauthenticated attacker with network access can invoke this function with a crafted string to inject properties into Object.prototype, poisoning the prototype chain. The attack is trivial to perform: `expand("__proto__.polluted:Polluted!")` makes the polluted property available to all objects. Impact ranges from denial of service (if polluted properties break application logic) to property injection attacks (tampering with security-relevant values like isAdmin) to remote code execution (if the application evaluates polluted properties). No patch is currently available for this library.

Affected products

  • jonschlinkert expand-object 0.0.0 through 0.4.2

Identifiers

  • CVE-2025-3197
  • GHSA-4vjr-hfpp-2m7w

Timeline

  • 2023-08-06: disclosed
  • 2025-04-04: advisory

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.