CVE-2025-61140

9.8 CRITICAL

📋 TL;DR

CVE-2025-61140 is a prototype pollution vulnerability in jsonpath 1.1.1 that allows attackers to modify object prototypes, potentially leading to remote code execution or denial of service. This affects any application using the vulnerable jsonpath library version. The vulnerability is particularly dangerous because it can be exploited through user-controlled JSON input.

💻 Affected Systems

Products:
  • jsonpath library
Versions: Version 1.1.1 specifically
Operating Systems: All operating systems running Node.js applications
Default Config Vulnerable: ⚠️ Yes
Notes: Any application using jsonpath 1.1.1 to parse user-controlled JSON is vulnerable. The vulnerability is in the lib/index.js value function.

📦 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 privilege escalation within the affected application.

🟢

If Mitigated

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

🌐 Internet-Facing: HIGH - Exploitable via user-controlled JSON input in web applications or APIs.
🏢 Internal Only: MEDIUM - Still exploitable by authenticated users or through internal API calls.

🎯 Exploit Status

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

Proof of concept available in the GitHub gist reference. Exploitation requires user-controlled JSON input to the vulnerable function.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 1.1.2 or later

Vendor Advisory: https://github.com/dchester/jsonpath

Restart Required: Yes

Instructions:

1. Update jsonpath dependency to version 1.1.2 or later. 2. Run 'npm update jsonpath' or update package.json. 3. Restart all affected applications. 4. Test functionality after update.

🔧 Temporary Workarounds

Input validation and sanitization

all

Implement strict input validation to reject malicious JSON structures before they reach the jsonpath parser.

Object.freeze on prototypes

all

Freeze Object.prototype and other critical prototypes to prevent pollution.

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

🧯 If You Can't Patch

  • Implement strict input validation and sanitization for all JSON inputs
  • Use web application firewalls (WAF) with JSON payload inspection rules
  • Isolate affected applications in network segments with limited access
  • Monitor for unusual application behavior or crashes

🔍 How to Verify

Check if Vulnerable:

Check package.json or run 'npm list jsonpath' to see if version 1.1.1 is installed. Review code for jsonpath usage with user input.

Check Version:

npm list jsonpath | grep jsonpath

Verify Fix Applied:

Run 'npm list jsonpath' to confirm version is 1.1.2 or later. Test application functionality with valid JSON inputs.

📡 Detection & Monitoring

Log Indicators:

  • Application crashes or unexpected behavior when processing JSON
  • Unusual error messages related to object prototypes or JSON parsing
  • High CPU/memory usage during JSON processing

Network Indicators:

  • Unusual JSON payloads in HTTP requests
  • Multiple requests with malformed JSON structures
  • Requests to endpoints that process JSON data

SIEM Query:

source="web_server" AND (message="*prototype*" OR message="*jsonpath*" OR message="*unexpected token*")

🔗 References

📤 Share & Export