Skip to main content
Vulnerability Database/CVE-2026-55823

CVE-2026-55823: Frappe Framework SQL Injection Vulnerability

CVE-2026-55823 is a SQL injection flaw in Frappe web framework that allows attackers to alter SQL queries through crafted report input. This post explains its impact, affected versions, and mitigation steps.

Published:

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

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-55823 Overview

CVE-2026-55823 is a SQL injection vulnerability [CWE-89] in the Frappe full-stack web application framework. The flaw resides in the get_count() method within frappe/desk/reportview.py. This method composes a count operation around generated SQL through a raw database execution path. Crafted report input can alter the SQL statement executed by the application, enabling attackers with low-privileged access to manipulate database queries.

The vulnerability affects all versions prior to 16.23.0. The maintainers released a fix in version 16.23.0 by refactoring get_count() to use the query builder (qb) instead of raw SQL.

Critical Impact

Authenticated attackers can inject arbitrary SQL through the reportview get_count() endpoint, exposing confidential data and modifying database records.

Affected Products

  • Frappe Framework versions prior to 16.23.0
  • Applications built on Frappe (including ERPNext deployments) that expose the reportview endpoint
  • Self-hosted and cloud deployments running vulnerable Frappe releases

Discovery Timeline

  • 2026-10-13 - CVE CVE-2026-55823 published to NVD
  • 2026-10-13 - Last updated in NVD database

Technical Details for CVE-2026-55823

Vulnerability Analysis

The get_count() method in frappe/desk/reportview.py is a whitelisted endpoint that returns record counts for report views. The method accepts form parameters from the client and constructs a SQL count query using raw string composition. Because the parameters flow into a raw database execution path without sufficient parameterization, an authenticated user can supply report input that alters the structure of the executed SQL statement.

The method is exposed through @frappe.whitelist(), meaning any authenticated user can invoke it. The vulnerability enables unauthorized read access to database contents and can be used to tamper with query logic. Combined with Frappe's broad adoption in ERP and business platforms, the issue can expose customer, financial, and operational data.

Root Cause

The root cause is the use of raw SQL composition inside get_count() instead of the Frappe query builder. User-controlled values from get_form_params() reach the database layer without going through parameter binding that would isolate values from SQL syntax. This matches the classic SQL injection pattern described in [CWE-89].

Attack Vector

An authenticated attacker sends a crafted request to the reportview get_count() endpoint. The malicious input is embedded in report parameters such as filters, doctype references, or related fields consumed by the count operation. Because the request originates from a legitimate session, standard authentication controls do not block it, and the injected SQL executes with the database privileges of the Frappe application user.

python
@frappe.whitelist()
@frappe.read_only()
def get_count() -> int | None:
+	from frappe.query_builder.functions import Count
+
	args = get_form_params()

	if is_virtual_doctype(args.doctype):

Source: GitHub Commit 49dbde7460fa. The patch imports the Count function from frappe.query_builder.functions so the count operation can be constructed through the parameterized query builder rather than raw SQL.

Detection Methods for CVE-2026-55823

Indicators of Compromise

  • Unexpected HTTP POST requests to /api/method/frappe.desk.reportview.get_count containing SQL metacharacters such as single quotes, UNION, SELECT, or comment sequences in parameters.
  • Database error entries in Frappe logs referencing malformed count queries originating from reportview.
  • Authenticated sessions issuing high volumes of reportview requests with varied doctype or filters payloads consistent with injection probing.

Detection Strategies

  • Review web server and application logs for requests to the reportview get_count method containing SQL syntax tokens in query parameters or form bodies.
  • Enable database query logging on the backing MariaDB or PostgreSQL instance and alert on queries containing operators injected outside of expected count structures.
  • Correlate authentication events with reportview invocations to flag low-privilege accounts generating anomalous query patterns.

Monitoring Recommendations

  • Deploy a web application firewall (WAF) ruleset to inspect requests to Frappe reportview endpoints for SQL injection payloads.
  • Monitor outbound database traffic for unusual response sizes that may indicate data exfiltration via injected queries.
  • Track the Frappe application version across environments and alert when hosts remain on releases below 16.23.0.

How to Mitigate CVE-2026-55823

Immediate Actions Required

  • Upgrade Frappe to version 16.23.0 or later, which refactors get_count() to use the query builder.
  • Audit application logs for prior reportview requests containing SQL metacharacters and investigate any matching authenticated sessions.
  • Rotate database credentials and session tokens if evidence of exploitation is identified.

Patch Information

The fix is delivered in GitHub Release v16.23.0. Technical details are available in GitHub Security Advisory GHSA-mf6r-q34j-pjw7. The underlying code change replaces raw SQL composition in get_count() with the parameterized Count function from frappe.query_builder.functions, as implemented in GitHub Pull Request #40022 and GitHub Pull Request #40027.

Workarounds

  • Restrict access to the Frappe desk and reportview endpoints to trusted internal networks until patching is complete.
  • Apply WAF rules that block SQL metacharacters in parameters sent to frappe.desk.reportview.get_count.
  • Enforce the principle of least privilege on the database user backing the Frappe application to limit the impact of any residual injection.
bash
# Upgrade Frappe to the patched release using bench
bench update --upgrade
bench version | grep frappe
# Confirm the installed frappe version is 16.23.0 or later

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

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

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.