CVE-2022-21190

7.5 HIGH

📋 TL;DR

CVE-2022-21190 is a prototype pollution vulnerability in the convict configuration management library for Node.js that allows attackers to modify object prototypes by bypassing the fix for CVE-2022-22143. This affects applications using convict for configuration management, potentially leading to denial of service, remote code execution, or privilege escalation. The vulnerability is exploitable when user-controlled input reaches convict's configuration parsing.

💻 Affected Systems

Products:
  • convict
Versions: All versions before 6.2.3
Operating Systems: All operating systems running Node.js
Default Config Vulnerable: ⚠️ Yes
Notes: Applications must use convict for configuration management and accept user input that reaches convict's parsing functions.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Remote code execution leading to complete system compromise, data exfiltration, or lateral movement within the environment.

🟠

Likely Case

Denial of service through application crashes or unexpected behavior, or privilege escalation within the application context.

🟢

If Mitigated

Limited impact with proper input validation and sandboxing, potentially only causing configuration errors.

🌐 Internet-Facing: HIGH - Web applications using convict that accept user input for configuration are directly exposed.
🏢 Internal Only: MEDIUM - Internal services using convict with user-controlled configuration inputs remain vulnerable.

🎯 Exploit Status

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

Exploitation requires user input to reach convict's configuration parsing. Public proof-of-concept demonstrates the bypass technique.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 6.2.3

Vendor Advisory: https://github.com/mozilla/node-convict/blob/master/CHANGELOG.md#623---2022-05-07

Restart Required: Yes

Instructions:

1. Update convict package to version 6.2.3 or later using npm: npm update convict@^6.2.3. 2. Restart all Node.js applications using convict. 3. Verify the update with npm list convict.

🔧 Temporary Workarounds

Input validation and sanitization

all

Implement strict input validation to prevent user-controlled data from reaching convict's configuration parsing functions.

Environment isolation

all

Run Node.js applications in isolated containers or sandboxes to limit potential damage from exploitation.

🧯 If You Can't Patch

  • Implement strict input validation and sanitization for all configuration inputs
  • Monitor application logs for unusual configuration parsing errors or crashes

🔍 How to Verify

Check if Vulnerable:

Check package.json or run npm list convict to see if version is below 6.2.3

Check Version:

npm list convict | grep convict

Verify Fix Applied:

Verify convict version is 6.2.3 or higher with npm list convict and test configuration parsing with known malicious inputs

📡 Detection & Monitoring

Log Indicators:

  • Unusual configuration parsing errors
  • Application crashes related to configuration loading
  • Unexpected prototype modifications in logs

Network Indicators:

  • Unusual configuration payloads in HTTP requests to configuration endpoints

SIEM Query:

source="application.logs" AND ("convict" OR "configuration error") AND ("__proto__" OR "constructor.prototype")

🔗 References

📤 Share & Export