CVE-2021-3815

9.8 CRITICAL

📋 TL;DR

CVE-2021-3815 is a prototype pollution vulnerability in utils.js that allows attackers to modify object prototypes, potentially leading to denial of service, remote code execution, or privilege escalation. This affects applications using vulnerable versions of the utils.js library. Developers and organizations using this library in their Node.js applications are at risk.

💻 Affected Systems

Products:
  • utils.js
Versions: Versions before 0.3.6
Operating Systems: All operating systems running Node.js
Default Config Vulnerable: ⚠️ Yes
Notes: Any application importing and using utils.js functions that handle object merging or property assignment is vulnerable.

📦 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, application crashes, or limited privilege escalation within the application context.

🟢

If Mitigated

Limited impact with proper input validation and security controls, potentially only causing application instability.

🌐 Internet-Facing: HIGH - Web applications using this library are directly exposed to exploitation attempts.
🏢 Internal Only: MEDIUM - Internal applications are still vulnerable but have reduced attack surface.

🎯 Exploit Status

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

Proof-of-concept exploits are publicly available, making exploitation straightforward for attackers.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 0.3.6 and later

Vendor Advisory: https://github.com/fabiocaccamo/utils.js/commit/102efafb291ce1916985514440d3bf8a6826890a

Restart Required: Yes

Instructions:

1. Update package.json to use utils.js version 0.3.6 or higher. 2. Run 'npm update utils.js' or 'yarn upgrade utils.js'. 3. Restart your application. 4. Test functionality to ensure compatibility.

🔧 Temporary Workarounds

Input validation wrapper

all

Implement custom input validation for all object manipulation functions to reject suspicious properties.

Object.freeze on prototypes

all

Freeze critical object prototypes to prevent modification.

Object.freeze(Object.prototype);
Object.freeze(Array.prototype);

🧯 If You Can't Patch

  • Implement strict Content Security Policy and input validation at application layer
  • Isolate vulnerable components in sandboxed environments or containers

🔍 How to Verify

Check if Vulnerable:

Check package.json or package-lock.json for utils.js version. If version is below 0.3.6, you are vulnerable.

Check Version:

npm list utils.js | grep utils.js

Verify Fix Applied:

After updating, verify the version is 0.3.6 or higher using 'npm list utils.js' or check package.json.

📡 Detection & Monitoring

Log Indicators:

  • Unusual object property modifications
  • Application crashes with prototype-related errors
  • Unexpected __proto__ or constructor property assignments

Network Indicators:

  • HTTP requests with specially crafted JSON payloads containing __proto__ properties

SIEM Query:

source="application.logs" AND ("__proto__" OR "prototype pollution" OR "utils.js")

🔗 References

📤 Share & Export