Skip to main content
CVE Vulnerability Database
Vulnerability Database/CVE-2025-52048

CVE-2025-52048: Frappe Frappe SQL Injection Vulnerability

CVE-2025-52048 is a SQL injection vulnerability in Frappe Frappe that allows attackers to extract database information through the dt parameter. This article covers technical details, affected versions, impact, and mitigation.

Published:

CVE-2025-52048 Overview

CVE-2025-52048 is a SQL Injection vulnerability [CWE-89] in the Frappe Framework, a full-stack web application framework used by ERPNext and other business applications. The flaw resides in the add_tag() function located at frappe/desk/doctype/tag/tag.py. An attacker can inject arbitrary SQL statements through the dt parameter to extract sensitive information from the underlying database. The vulnerability affects Frappe versions 15.x.x before 15.72.0 and 14.x.x before 14.96.10. The issue was disclosed via GitHub Security Advisory GHSA-mggw-6xqj-rphj and requires no authentication or user interaction to exploit over the network.

Critical Impact

Network-accessible SQL injection allows unauthenticated attackers to extract data from Frappe-backed databases through the dt parameter of the add_tag() function.

Affected Products

  • Frappe Framework 15.x.x prior to 15.72.0
  • Frappe Framework 14.x.x prior to 14.96.10
  • Downstream applications built on Frappe (including ERPNext deployments using the affected versions)

Discovery Timeline

  • 2025-09-15 - CVE-2025-52048 published to NVD
  • 2026-06-17 - Last updated in NVD database

Technical Details for CVE-2025-52048

Vulnerability Analysis

The vulnerability is a classic SQL Injection flaw [CWE-89] in the Frappe Framework's tagging subsystem. The add_tag() function at frappe/desk/doctype/tag/tag.py accepts a dt parameter that identifies the DocType to which a tag will be applied. The function concatenates the dt value into a SQL statement without proper parameterization or sanitization. An attacker submits crafted input in the dt parameter to break out of the intended SQL context and append arbitrary clauses. This allows extraction of arbitrary data from the underlying database, including credential material, session tokens, and business records stored in Frappe DocTypes.

Root Cause

The root cause is unsafe construction of a SQL query using user-controlled input. The dt parameter passed to add_tag() is interpolated into a query string rather than bound as a parameterized value. Frappe's own database abstraction supports parameter binding, but this code path bypasses that protection. The GitHub advisory GHSA-mggw-6xqj-rphj lists this among multiple SQL injection issues corrected in the 15.72.0 and 14.96.10 releases.

Attack Vector

Exploitation requires network access to a Frappe web endpoint that reaches the vulnerable add_tag() handler. The attacker sends an HTTP request containing a malicious dt parameter carrying an SQL payload such as a UNION-based extraction or a boolean-based blind injection. Because the CVSS vector reports no privileges required, the endpoint is reachable without prior authentication in vulnerable deployments. Successful exploitation yields read access to database contents; write and availability impact are not indicated in the CVSS metrics.

No verified public proof-of-concept code is available. Technical detail is documented in the GitHub Vulnerability Disclosure and the GitHub Security Advisory GHSA-mggw-6xqj-rphj.

Detection Methods for CVE-2025-52048

Indicators of Compromise

  • HTTP requests to Frappe tag endpoints containing SQL metacharacters (', --, UNION, SELECT, SLEEP) in the dt parameter
  • Database logs showing malformed or unexpected queries originating from the add_tag() code path
  • Unusual outbound data volume from the Frappe application server following requests to tag-related URLs
  • Application error logs referencing frappe/desk/doctype/tag/tag.py with SQL syntax errors

Detection Strategies

  • Inspect web server access logs for requests to tag-management endpoints with suspicious dt parameter values
  • Enable and review MariaDB or MySQL query logs for statements referencing the tag DocType with abnormal syntax
  • Deploy WAF signatures for common SQL injection patterns targeting Frappe endpoints
  • Correlate authentication events with subsequent tag-endpoint activity to identify unauthenticated exploitation attempts

Monitoring Recommendations

  • Alert on repeated HTTP 500 responses from Frappe endpoints, which often accompany injection probing
  • Monitor for anomalous SELECT queries executing against sensitive DocTypes such as tabUser or tabAPI Key
  • Track outbound network egress from the Frappe application server for indicators of bulk data exfiltration
  • Forward Frappe application, web server, and database logs to a central analytics platform for correlation

How to Mitigate CVE-2025-52048

Immediate Actions Required

  • Upgrade Frappe to version 15.72.0 or later on the 15.x branch
  • Upgrade Frappe to version 14.96.10 or later on the 14.x branch
  • Restrict network exposure of Frappe administrative and desk endpoints to trusted networks or VPN
  • Rotate database credentials and API keys if exploitation is suspected in logs

Patch Information

The Frappe maintainers released fixed versions 15.72.0 and 14.96.10 addressing the SQL injection in add_tag(). Details are documented in the GitHub Security Advisory GHSA-mggw-6xqj-rphj. Administrators running ERPNext or other Frappe-based applications should coordinate the Frappe upgrade with any dependent application version requirements.

Workarounds

  • Place a Web Application Firewall in front of the Frappe deployment with rules blocking SQL metacharacters in dt parameters
  • Limit access to /api/method/frappe.desk.doctype.tag.tag.add_tag and related endpoints to authenticated internal users only
  • Enforce least-privilege on the database account used by Frappe so injection queries cannot read tables outside the application schema
  • Enable database query auditing to record and alert on unexpected access patterns until patching completes
bash
# Upgrade Frappe using bench (example for a bench-managed deployment)
bench update --reset
bench --site all migrate
# Verify installed version meets the fixed release
bench version | grep frappe

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.