CVE-2024-38991

8.8 HIGH

📋 TL;DR

CVE-2024-38991 is a prototype pollution vulnerability in akbr patch-into v1.0.1 that allows attackers to inject arbitrary properties into JavaScript objects. This can lead to remote code execution or denial of service attacks affecting any application using this vulnerable library.

💻 Affected Systems

Products:
  • akbr patch-into
Versions: v1.0.1
Operating Systems: All platforms running Node.js
Default Config Vulnerable: ⚠️ Yes
Notes: Any application using patchInto function with untrusted input is vulnerable.

⚠️ Manual Verification Required

This CVE does not have specific version information in our database, so automatic vulnerability detection cannot determine if your system is affected.

Why? The CVE database entry doesn't specify which versions are vulnerable (no version ranges provided by the vendor/NVD).

🔒 Custom verification scripts are available for registered users. Sign up free to download automated test scripts.

Recommended Actions:
  1. Review the CVE details at NVD
  2. Check vendor security advisories for your specific version
  3. Test if the vulnerability is exploitable in your environment
  4. Consider updating to the latest version as a precaution

⚠️ Risk & Real-World Impact

🔴

Worst Case

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

🟠

Likely Case

Denial of service causing application crashes or instability, potentially leading to data corruption.

🟢

If Mitigated

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

🌐 Internet-Facing: HIGH - Web applications using this library are directly exposed to exploitation via user input.
🏢 Internal Only: MEDIUM - Internal applications could be exploited by authenticated users or through other attack vectors.

🎯 Exploit Status

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

Proof of concept available in GitHub gists showing exploitation via property injection.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Not available

Vendor Advisory: No official vendor advisory found

Restart Required: No

Instructions:

1. Remove akbr patch-into v1.0.1 from your project
2. Find alternative library or implement custom patching functionality
3. Update package.json to exclude vulnerable version
4. Run npm audit fix if available

🔧 Temporary Workarounds

Input validation wrapper

all

Create wrapper function that validates input objects before passing to patchInto

// JavaScript implementation
function safePatchInto(target, source) {
  if (typeof source !== 'object' || source === null) {
    throw new Error('Invalid source object');
  }
  // Validate property names don't contain dangerous patterns
  const dangerousProps = ['__proto__', 'constructor', 'prototype'];
  for (const prop in source) {
    if (dangerousProps.includes(prop)) {
      throw new Error(`Dangerous property detected: ${prop}`);
    }
  }
  return patchInto(target, source);
}

🧯 If You Can't Patch

  • Implement strict Content Security Policy (CSP) to limit script execution
  • Deploy web application firewall (WAF) rules to detect and block prototype pollution attempts

🔍 How to Verify

Check if Vulnerable:

Check package.json for "akbr/patch-into" version 1.0.1 or run: npm list akbr/patch-into

Check Version:

npm list akbr/patch-into

Verify Fix Applied:

Verify package.json no longer contains akbr/patch-into v1.0.1 and run: npm audit

📡 Detection & Monitoring

Log Indicators:

  • Unusual property names in object manipulation logs
  • Application crashes with prototype-related errors
  • Unexpected __proto__ or constructor property assignments

Network Indicators:

  • HTTP requests with unusual property names in JSON payloads
  • Patterns of property injection attempts

SIEM Query:

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

🔗 References

📤 Share & Export