CVE-2025-57347 Overview
A prototype pollution vulnerability has been identified in the dagre-d3-es Node.js package version 7.0.9. The vulnerability exists within the bk module's addConflict function, which fails to properly sanitize user-supplied input during property assignment operations. This flaw enables attackers to inject malicious input values such as __proto__, allowing unauthorized modification of the JavaScript Object prototype chain.
Prototype pollution is a particularly dangerous class of vulnerability in JavaScript environments, as it can affect all objects inheriting from the polluted prototype. Successful exploitation could lead to denial of service conditions, unexpected application behavior, or potential execution of arbitrary code in contexts where polluted properties are later accessed or executed.
Critical Impact
This vulnerability allows remote attackers to pollute the JavaScript Object prototype without authentication, potentially leading to arbitrary code execution, denial of service, or complete application compromise in affected Node.js applications.
Affected Products
- tbo47 dagre-d3-es version 7.0.9
- tbo47 dagre-d3-es versions prior to 7.0.11
Discovery Timeline
- 2025-09-24 - CVE CVE-2025-57347 published to NVD
- 2025-10-17 - Last updated in NVD database
Technical Details for CVE-2025-57347
Vulnerability Analysis
The vulnerability is classified under CWE-1321 (Improperly Controlled Modification of Object Prototype Attributes), commonly known as Prototype Pollution. This class of vulnerability occurs when an application allows user input to modify the prototype of base objects in JavaScript.
In the case of dagre-d3-es, the addConflict function within the bk module accepts user-controlled input without proper validation. When special property names like __proto__, constructor, or prototype are passed as input, the function inadvertently modifies the Object prototype chain rather than creating or modifying a regular property.
The network-based attack vector means this vulnerability can be exploited remotely without requiring any user interaction or prior authentication. Applications using vulnerable versions of dagre-d3-es for graph layout and rendering operations are at risk if they process untrusted input through the affected module.
Root Cause
The root cause of this vulnerability lies in the absence of input sanitization within the addConflict function. When assigning properties to objects, the function does not verify whether the property name is a dangerous prototype attribute. JavaScript's dynamic nature allows special properties like __proto__ to modify the prototype chain when directly assigned, which the function fails to guard against.
Proper input validation should check for and reject known dangerous property names including __proto__, constructor, and prototype before performing any object property assignments.
Attack Vector
The attack vector for CVE-2025-57347 is network-based, requiring no privileges or user interaction. An attacker can craft malicious input containing prototype pollution payloads (e.g., {"__proto__": {"polluted": true}}) and send it to an application using the vulnerable dagre-d3-es package.
When the application processes this input through the addConflict function in the bk module, the malicious properties are written to the Object prototype. Subsequently, any object created in the application will inherit these polluted properties, potentially leading to:
- Denial of Service: Polluting properties that cause application crashes or infinite loops
- Property Injection: Injecting properties that bypass security checks or alter application logic
- Remote Code Execution: In certain contexts, polluted properties may be evaluated as code, leading to arbitrary code execution
Technical details and proof-of-concept information can be found in the GitHub PoC repository and the GitHub Issue Discussion.
Detection Methods for CVE-2025-57347
Indicators of Compromise
- Unexpected properties appearing on JavaScript objects that were not explicitly defined
- Application crashes or errors related to prototype chain modifications
- Unusual behavior in graph rendering or layout operations using dagre-d3-es
- Log entries showing attempts to access or set __proto__, constructor, or prototype properties
Detection Strategies
- Implement dependency scanning tools to identify dagre-d3-es versions prior to 7.0.11 in your Node.js applications
- Use static analysis tools capable of detecting prototype pollution patterns in JavaScript code
- Monitor application logs for unusual property access patterns or prototype modification attempts
- Deploy runtime application self-protection (RASP) solutions that can detect prototype pollution attacks
Monitoring Recommendations
- Enable verbose logging for applications using the dagre-d3-es package to capture input validation failures
- Implement application performance monitoring to detect unexpected behavior changes that may indicate prototype pollution
- Set up alerts for package vulnerability notifications in your software composition analysis (SCA) tools
- Monitor for unusual object property access patterns in runtime environments
How to Mitigate CVE-2025-57347
Immediate Actions Required
- Audit your Node.js applications to identify usage of dagre-d3-es package versions 7.0.9 or earlier
- Update dagre-d3-es to version 7.0.11 or later where the vulnerability has been addressed
- Implement input validation to reject objects containing dangerous prototype properties before processing
- Consider using Object.freeze(Object.prototype) as a defense-in-depth measure in critical applications
Patch Information
The vulnerability affects dagre-d3-es versions prior to 7.0.11. Organizations should update to version 7.0.11 or later to address this security issue. Detailed information about the fix can be found in the GitHub Issue Discussion.
Workarounds
- Implement a sanitization wrapper around user input that filters out dangerous property names (__proto__, constructor, prototype) before passing data to dagre-d3-es functions
- Use Object.create(null) when creating objects that will store user-controlled keys to prevent prototype pollution
- Deploy a Web Application Firewall (WAF) with rules to detect and block prototype pollution payloads in incoming requests
- Consider using libraries like lodash.set with prototype pollution protections or the no-proto package to harden object operations
# Update dagre-d3-es to patched version
npm update dagre-d3-es@latest
# Or explicitly install the fixed version
npm install dagre-d3-es@7.0.11
# Verify installed version
npm list dagre-d3-es
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.


