Frappe ERPNext CVE-2025-66438
HIGHAttack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessAuthenticate with Print Format edit permission
-
DeliveryInject Jinja/frappe.db.sql payload into html field
-
ExploitSave malicious Print Format
-
ExecutionCall get_html_and_style() on target document
-
PersistServer renders template via get_rendered_template()
-
ImpactExfiltrate database schema and sensitive data
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Code injection prevention, sandbox exec
MITRE ATT&CK
2 techniques across 2 tactics: Execution, Initial Access The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Requires an authenticated session whose role grants permission to create or modify a Print Format document in Frappe ERPNext (through version 15.89.0) - this is a customization/administrative privilege, not a default end-user capability, which is the primary limiting factor. The attacker must be able to place a Jinja expression in the Print Format html field and then invoke the frappe.www.printview.get_html_and_style() API against any renderable document (e.g., Supplier, Sales Invoice). Exploitation leverages the fact that get_safe_globals() exposes frappe.db.sql inside the SandboxedEnvironment; effective data impact therefore depends on what that exposed global permits in the deployment. No user interaction by a victim is needed, and the trigger is reachable over the network, but the permission requirement and the Jinja sandbox (which constrains the payload to exposed globals rather than full OS access) bound realistic impact toward database information disclosure. |
| Impact | Signals are largely consistent and point to a genuine, actionable vulnerability rather than an inflated high-CVSS artifact. The CVSS 3.1 vector (AV:N/AC:L/PR:L/UI:N/S:U, 8.8) describes a network-reachable, low-complexity attack that nonetheless requires authentication (PR:L) - the description confirms this, stating the attacker must be an authenticated user with permission to create or modify a Print Format, which is typically an administrative/customization-level privilege and not granted to ordinary users. A public POC exists (two write-ups), which raises practical risk, but there is no CISA KEV listing and no EPSS score was provided, so there is no evidence of active or widespread exploitation - exploitation status is 'publicly available exploit code exists,' which must not be conflated with in-the-wild attacks. Note a tension between the metadata and the technical reality: the Tags claim 'RCE,' but the description explains that ERPNext wraps Jinja2 in a SandboxedEnvironment and the demonstrated impact is information disclosure via the exposed frappe.db.sql global (database version, schema, sensitive values), not confirmed arbitrary OS command execution - treat the RCE label as unverified. The input's I:H/A:H depend on frappe.db.sql permitting write/destructive SQL, which is plausible but not explicitly demonstrated in the description (which emphasizes disclosure). Net: a real priority for ERPNext operators who allow delegated Print Format editing, but the authentication precondition meaningfully narrows the realistic attacker population compared to an unauthenticated flaw. |
| Exploit ScenarioDerived | An authenticated user who has been delegated rights to customize Print Formats (e.g., a power user or junior admin) edits a Print Format and embeds a malicious Jinja expression in the html field invoking frappe.db.sql. They then call the frappe.www.printview.get_html_and_style() API against a target document such as a Supplier or Sales Invoice, triggering server-side template rendering that executes the injected query and returns database version, schema, or sensitive row data. A public proof-of-concept demonstrating this chain is available, lowering the effort required to reproduce it. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Oct 14, 2026
Authenticated attackers with permission to create or modify Print Format documents in Frappe ERPNext through 15.89.0 can exploit a Server-Side Template Injection flaw to read sensitive database information. The vulnerability arises because the Print Format rendering path exposes frappe.db.sql inside a Jinja2 SandboxedEnvironment, allowing crafted template expressions to query the backend database. Publicly available exploit code exists, and the CVSS score of 8.8 reflects high confidentiality, integrity, and availability impact, though exploitation requires a privileged customization role and no active exploitation in CISA KEV has been confirmed.
RemediationAI
No vendor-released patch version was identified in the available intelligence for CVE-2025-66438, so the primary remediation is to upgrade Frappe ERPNext beyond the affected 15.89.0 ceiling once a fixed release is available, and to verify the fix through the vendor's official channels. As compensating controls, restrict the ability to create or modify Print Format documents to a minimal set of trusted administrative roles, and audit existing Print Format html fields for unexpected Jinja expressions such as calls to frappe.db.sql or other sensitive globals; note that restricting this permission may reduce customization flexibility for power users. If operationally feasible, review and reduce the globals exposed by get_safe_globals() in the deployment, understanding that modifying framework internals can break legitimate Print Formats and requires testing. Monitor ERPNext logs and API calls to frappe.www.printview.get_html_and_style() for suspicious activity, and consider network-level restrictions on the API endpoint to trusted management networks, accepting that this may limit legitimate remote printing workflows.
Affects your stack
Find out whether the stacks and servers you run are on an affected version.
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
Frappe ERPNext uses Jinja2 templating to render Print Format documents. The API frappe.www.printview.get_html_and_style() calls get_rendered_template(), which invokes frappe.render_template(template, doc) on the html field of a Print Format. Although ERPNext wraps Jinja2 in a SandboxedEnvironment, the sandbox's get_safe_globals() exposes sensitive callables such as frappe.db.sql. This is a code injection vulnerability (CWE-94) where an attacker who can save a malicious Print Format can embed Jinja expressions that call these exposed globals and exfiltrate database version, schema, or sensitive values. The sandbox limits direct OS command execution but does not prevent database access through the allowed globals.
Know when Erpnext gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Network API trigger (AV:N) with no victim interaction, but creating/editing a Print Format needs an authenticated privileged role (PR:L); exposed frappe.db.sql enables read and destructive SQL, so C/I/A:H.
Primary rating from NVD.
CVSS VectorNVD
DescriptionNVD
A Server-Side Template Injection (SSTI) vulnerability exists in the Frappe ERPNext through 15.89.0 Print Format rendering mechanism. Specifically, the API frappe.www.printview.get_html_and_style() triggers the rendering of the html field inside a Print Format document using frappe.render_template(template, doc) via the get_rendered_template() call chain. Although ERPNext wraps Jinja2 in a SandboxedEnvironment, it exposes sensitive functions such as frappe.db.sql through get_safe_globals(). An authenticated attacker with permission to create or modify a Print Format can inject arbitrary Jinja expressions into the html field. Once the malicious Print Format is saved, the attacker can call get_html_and_style() with a target document (e.g., Supplier or Sales Invoice) to trigger the render process. This leads to information disclosure from the database, such as database version, schema details, or sensitive values, depending on the injected payload. Exploitation flow: Create a Print Format with SSTI payload in the html field; call the get_html_and_style() API; triggers frappe.render_template(template, doc) inside get_rendered_template(); leaks database information via frappe.db.sql or other exposed globals.
Executive ViewAI
Frappe ERPNext deployments up to version 15.89.0 expose sensitive backend database contents to anyone already holding Print Format customization privileges, through a template injection flaw in the print rendering path. Because ERPNext typically houses finance, HR, customer, and supplier records in a single database, a single successful abuse of this flaw can expose the organization's most sensitive business data and undermine the integrity of reporting built on it. Leadership should treat this as a data-exposure risk concentrated among privileged internal or contractor accounts rather than a broad external compromise, but one that is amplified by publicly available exploit code and the absence of a vendor fix.
No vendor-released patch identified at time of analysis. Interim mitigations: remove Print Format create/modify permissions from all but a minimal set of trusted administrators; audit and revert suspicious Print Format templates; restrict Jinja template access to database functions via server-side configuration or code-level overrides where feasible; monitor ERPNext logs for anomalous template rendering and database query activity; rotate credentials for accounts that held Print Format privileges; and isolate or segment the ERPNext database to limit lateral exposure of sensitive records.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.
Code injection occurs when an application accepts user input and passes it directly into a language interpreter or evaluator without proper sanitization.
Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.
Affected Products (CPE)NVD
Stored cross-site scripting leading to code execution in Frappe Framework 15.89.0 (and the ERPNext application built on
An exploitable SQL injection vulnerability exists in the authenticated part of ERPNext v10.1.6. Rated high severity (CVS
An exploitable SQL injection vulnerability exists in the authenticated part of ERPNext v10.1.6. Rated high severity (CVS
An exploitable SQL injection vulnerability exists in the authenticated part of ERPNext v10.1.6. Rated high severity (CVS
An exploitable SQL injection vulnerability exists in the authenticated part of ERPNext v10.1.6. Rated high severity (CVS
Authenticated SQL injection in Frappe ERPNext through 15.89.0 allows low-privilege users to extract arbitrary database c
SQL injection in Frappe ERPNext through 15.89.0 lets an authenticated attacker with a valid session and access to the Pa
Authenticated server-side template injection in Frappe ERPNext through 15.89.0 lets a user who can create or modify an A
Authenticated server-side template injection in Frappe ERPNext through 15.89.0 allows users with privileges to configure
An SQL injection vulnerability exists in the frappe.desk.reportview.get functionality of ERPNext 11.1.38. Rated high sev
Frappe Framework ERPNext 13.4.0 contains a sandbox escape vulnerability in RestrictedPython that allows authenticated us
In Frappe ERPNext 15.57.5, the function get_rfq_containing_supplier() at erpnext/buying/doctype/request_for_quotation/re
NVD
CVE.org
EPSS
GitHub PoC
Exploit-DB