CVE-2021-25912

9.8 CRITICAL

📋 TL;DR

This is a prototype pollution vulnerability in the 'dotty' JavaScript library that allows attackers to modify object prototypes, potentially leading to denial of service or remote code execution. Any application using vulnerable versions of dotty is affected, particularly Node.js applications that process untrusted user input.

💻 Affected Systems

Products:
  • dotty
Versions: 0.0.1 through 0.1.0
Operating Systems: All platforms running Node.js
Default Config Vulnerable: ⚠️ Yes
Notes: Any application using dotty to process untrusted data is vulnerable. The vulnerability exists in the library's core functionality.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Remote code execution leading to complete system compromise, data theft, or ransomware deployment.

🟠

Likely Case

Denial of service through application crashes or instability, with potential for limited remote code execution in specific configurations.

🟢

If Mitigated

Limited impact if input validation and sanitization are implemented, though prototype pollution can bypass some controls.

🌐 Internet-Facing: HIGH - Web applications processing user input are directly exposed to exploitation attempts.
🏢 Internal Only: MEDIUM - Internal applications could be exploited through authenticated users or lateral movement.

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

Prototype pollution exploits are well-documented and can be automated. The high CVSS score suggests weaponization is probable.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 0.1.1 and later

Vendor Advisory: https://github.com/deoxxa/dotty/commit/cd997d37917186c131be71501a698803f2b7ebdb

Restart Required: Yes

Instructions:

1. Update dotty dependency to version 0.1.1 or later. 2. Update package.json: 'dotty': '^0.1.1'. 3. Run 'npm update dotty' or 'yarn upgrade dotty'. 4. Restart the application.

🔧 Temporary Workarounds

Input validation and sanitization

all

Implement strict input validation to reject malformed objects that could trigger prototype pollution.

Object.freeze on prototypes

all

Freeze Object.prototype to prevent prototype pollution attacks.

Object.freeze(Object.prototype);

🧯 If You Can't Patch

  • Implement strict input validation and sanitization for all user-controlled data
  • Use alternative libraries like lodash.get or implement custom safe property access functions

🔍 How to Verify

Check if Vulnerable:

Check package.json or package-lock.json for dotty version. If version is between 0.0.1 and 0.1.0 inclusive, the system is vulnerable.

Check Version:

npm list dotty | grep dotty

Verify Fix Applied:

Verify dotty version is 0.1.1 or later in package.json and test application functionality with known safe inputs.

📡 Detection & Monitoring

Log Indicators:

  • Unexpected application crashes
  • Unusual memory usage patterns
  • Errors related to object property access

Network Indicators:

  • Unusual HTTP requests with nested object structures
  • Requests containing __proto__ or constructor properties

SIEM Query:

source="application.logs" AND ("prototype pollution" OR "dotty" OR "CVE-2021-25912")

🔗 References

📤 Share & Export