/

CVE-2026-44447

Severity:

HIGH RISK

(8.8)

SQL Injection in ERPNext HTTP Endpoints

CVE-2026-44447

Analyzed

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Confidentiality breach via unauthorized data access (SQL Injection)

Severity:

HIGH RISK

(8.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Some ERPNext HTTP endpoints prior to version 16.9.0 are vulnerable to SQL injection when handling specially crafted requests, allowing untrusted input to be embedded directly into database queries.

Under these conditions, a malicious actor may extract sensitive information from the ERP database and potentially pivot to broader data exposure depending on query context and permissions.

Affected context

The vulnerability affects ERPNext deployments using versions prior to 16.9.0 where certain web-accessible endpoints build SQL queries using request parameters without robust parameterization or validation.

It is most relevant in environments where these endpoints are exposed over a network (e.g., Internet-facing or intra-organization) and backed by a relational database containing business-critical ERP data such as financial records, customer details, or operational information.

Exploit preconditions

  • Attack surface: HTTP(S) endpoints in ERPNext that accept query-related parameters (e.g., filters, search parameters, or identifiers).
  • Required access: Ability to send crafted HTTP requests to the affected endpoints; this may be possible to both authenticated and unauthenticated users depending on how the site is configured.
  • Trigger point: The application concatenates or embeds user-controlled parameters into SQL queries that are executed by the backend database.
  • Why exploitation is possible: Input is not consistently parameterized or sanitized, allowing attacker-controlled syntax to alter the structure of the SQL query instead of being treated purely as data.

Why this happens

The issue stems from constructing SQL statements using string concatenation or interpolation of request parameters instead of using parameterized queries or a safe query abstraction.

This aligns with CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), where the application mixes control and data channels and fails to neutralize metacharacters like quotes, operators, or logical expressions.

In abstract terms, any code path that directly embeds user input into SQL without binding it as a parameter makes the query interpreter treat attacker input as executable query logic, enabling unauthorized data reading and manipulation.

Potential impact

  • Unauthorized reading of sensitive records such as customer data, financial information, or internal operational data.
  • Enumeration of database schema, including table names, column names, and metadata.
  • Circumvention of application-level access controls at the data layer by directly querying tables.
  • Potential chaining with other weaknesses to escalate impact, such as discovering credentials or secrets stored within the database.

General mitigation guidance

Mitigations generally focus on separating data from control in all database access layers and shrinking the trust boundary of user input:

  • Use parameterized queries or ORM abstractions that bind values separately from SQL structure in every data-access path.
  • Apply strict input validation and allowlisting on request parameters that influence filtering, sorting, or selection logic.
  • Centralize query-building utilities to reduce ad-hoc string-based SQL construction and to enforce safe patterns by default.
  • Configure database accounts used by the application with least-privilege, limiting the scope of data accessible through any single compromised query.
  • Implement consistent secure coding guidelines and training around query construction for developers working on ERPNext extensions or custom endpoints.

How teams detect issues like this

Organizations can approach detection through a combination of code-level and runtime techniques:

  • Static analysis: Configure rules to flag string-built SQL queries, concatenation of request parameters into query strings, or dynamic WHERE/ORDER BY clauses without parameter binding.
  • Code review: Pay particular attention to custom endpoints, reporting features, and search/filter functions that directly transform request parameters into SQL fragments.
  • Policy enforcement: Introduce coding standards that mandate use of a standard query abstraction layer and forbid raw SQL concatenation, enforced via linters or pre-commit hooks.
  • Runtime monitoring: Analyze database logs and application logs for anomalous queries containing suspicious patterns (e.g., tautologies, UNION clauses, or comment markers originating from user input).

Sources

SourceLink
github.comgithub.com/frappe/erpnext/security/advisories/GHSA-q65v-fm9p-9vh3

Frequently asked

questions

Exploitability depends on which endpoints are exposed and how they are configured; any endpoint reachable by an attacker that builds SQL using untrusted parameters could be targeted, especially if it is Internet-facing or accessible from untrusted network segments.

Not necessarily. Some endpoints may be publicly accessible, while others may require login. The critical factor is whether an attacker can send crafted inputs to a vulnerable endpoint; authenticated contexts can still be dangerous if they are broadly accessible.

The most robust pattern is to eliminate string-based SQL construction entirely in favor of parameterized queries or a safe ORM, ensuring that all user-supplied data is passed as bound parameters and never as raw SQL fragments.

Prevention typically involves adopting secure query APIs by default, enforcing coding standards in code review and CI, integrating static analysis to catch unsafe patterns early, and limiting database privileges so that even if a query is compromised, the accessible data and actions are minimized.

Find out what's already
exploitable in your codebase.