CVE-2025-22992

9.8 CRITICAL

📋 TL;DR

A critical SQL injection vulnerability in Emoncms allows attackers to execute arbitrary SQL commands through the /feed/insert.json endpoint. This affects Emoncms installations version 11.6.9 and above, potentially compromising database integrity and confidentiality. Attackers can exploit this to steal sensitive data, modify database contents, or gain unauthorized access.

💻 Affected Systems

Products:
  • Emoncms
Versions: >= 11.6.9
Operating Systems: All
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects installations with the vulnerable endpoint accessible. The /feed/insert.json endpoint must be reachable.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete database compromise including data theft, data manipulation, privilege escalation, and potential remote code execution through database functions.

🟠

Likely Case

Data exfiltration from the database, unauthorized data modification, and potential authentication bypass.

🟢

If Mitigated

Limited impact with proper input validation and parameterized queries in place, though some risk remains if other vulnerabilities exist.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

SQL injection typically has low exploitation complexity. The vulnerability is in a publicly accessible endpoint with user-supplied input.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Check latest Emoncms release or commit fixing issue #1916

Vendor Advisory: https://github.com/emoncms/emoncms/issues/1916

Restart Required: No

Instructions:

1. Update Emoncms to the latest version. 2. Apply the fix from the GitHub issue #1916 if updating isn't possible. 3. Verify the fix by testing the vulnerable endpoint.

🔧 Temporary Workarounds

Input Validation and Sanitization

all

Implement strict input validation and sanitization for the data query parameter in the /feed/insert.json endpoint.

Web Application Firewall (WAF)

all

Deploy a WAF with SQL injection rules to block malicious requests to the vulnerable endpoint.

🧯 If You Can't Patch

  • Restrict access to the /feed/insert.json endpoint using network ACLs or authentication.
  • Monitor logs for unusual SQL queries or access patterns to the vulnerable endpoint.

🔍 How to Verify

Check if Vulnerable:

Test the /feed/insert.json endpoint with SQL injection payloads in the data parameter. If the application returns database errors or unexpected behavior, it may be vulnerable.

Check Version:

Check the Emoncms version in the application's admin panel or configuration files.

Verify Fix Applied:

After patching, retest with SQL injection payloads. The application should reject or sanitize the input without executing SQL commands.

📡 Detection & Monitoring

Log Indicators:

  • Unusual SQL queries in application logs
  • Errors related to SQL syntax from the /feed/insert.json endpoint
  • Multiple failed requests to the endpoint

Network Indicators:

  • HTTP requests to /feed/insert.json with SQL keywords in parameters
  • Abnormal traffic patterns to the endpoint

SIEM Query:

source="application_logs" AND (url_path="/feed/insert.json" AND (message="SQL" OR message="syntax"))

🔗 References

📤 Share & Export