CVE-2025-52042

8.2 HIGH

📋 TL;DR

This SQL injection vulnerability in Frappe ERPNext allows attackers to execute arbitrary SQL queries through the txt parameter in the get_rfq_containing_supplier() function. Successful exploitation enables complete database extraction, potentially exposing sensitive business data. All organizations running vulnerable versions of ERPNext are affected.

💻 Affected Systems

Products:
  • Frappe ERPNext
Versions: 15.57.5 and potentially earlier versions
Operating Systems: All
Default Config Vulnerable: ⚠️ Yes
Notes: Any deployment using the vulnerable function is affected regardless of configuration.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete database compromise including sensitive business data, financial records, customer information, and credentials leading to data breach, financial loss, and regulatory penalties.

🟠

Likely Case

Extraction of sensitive business data including supplier information, pricing data, and internal documents, potentially enabling further attacks.

🟢

If Mitigated

Limited data exposure if database permissions are restricted, but still significant risk to application data.

🌐 Internet-Facing: HIGH
🏢 Internal Only: HIGH

🎯 Exploit Status

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

Exploitation requires access to the vulnerable endpoint but SQL injection payloads are well-documented and easy to craft.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Check GitHub commit 7f2a52ff71a1fd5d4a9034cf217094c0be9f341a

Vendor Advisory: https://github.com/frappe/erpnext/pull/49192/commits/7f2a52ff71a1fd5d4a9034cf217094c0be9f341a

Restart Required: Yes

Instructions:

1. Update to patched version of ERPNext 2. Apply the specific commit fixing SQL injection 3. Restart the application server 4. Verify the fix is applied

🔧 Temporary Workarounds

Input Validation Filter

all

Add input validation to sanitize the txt parameter before processing

Implement parameterized queries or input sanitization in the vulnerable function

WAF Rule

all

Deploy web application firewall rules to block SQL injection patterns

Configure WAF to detect and block SQL injection patterns in request parameters

🧯 If You Can't Patch

  • Implement strict input validation and parameterized queries for all user inputs
  • Restrict database user permissions to minimum required access

🔍 How to Verify

Check if Vulnerable:

Test the vulnerable endpoint with SQL injection payloads in the txt parameter and monitor for database errors or unexpected responses.

Check Version:

Check ERPNext version in admin panel or via bench version command

Verify Fix Applied:

Verify the patched code uses parameterized queries and test with SQL injection payloads to confirm they're blocked.

📡 Detection & Monitoring

Log Indicators:

  • Unusual SQL queries in database logs
  • Multiple failed login attempts or parameter manipulation
  • Requests with SQL keywords in txt parameter

Network Indicators:

  • Unusual database connection patterns
  • Large data transfers from database server

SIEM Query:

search 'txt parameter' AND (SELECT OR UNION OR INSERT OR DELETE) in web server logs

🔗 References

📤 Share & Export