Frappe ERPNext
CVE-2025-66437
HIGH
Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessAuthenticate with Address Template edit rights
-
DeliveryInject Jinja payload into template field
-
ExploitCreate Address with matching country
-
ExecutionCall get_address_display API (address_dict=address_name)
-
Persistrender_template executes payload in sandbox
-
ImpactCode execution / database disclosure on server
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 | Exploitation requires an authenticated account holding the specific permission to create or modify an Address Template document in ERPNext, plus the ability to create an Address document with a country matching the malicious template and to call the get_address_display API with address_dict set to that Address document's name. The core technical prerequisite is that the custom Jinja2 SandboxedEnvironment still exposes dangerous callables such as frappe.db.sql via get_safe_globals(), which is the default framework behavior. Limiting factors that reduce real-world risk: the attacker must already be authenticated and must have Address Template write permission (an administrative-level capability typically not granted to ordinary users), so deployments that restrict Address Template editing to trusted administrators substantially narrow the exposed population; versions through 15.89.0 are affected. |
| Impact | This is a genuine high-priority issue, though not an emergency. The CVSS 3.1 vector (AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H, base 8.8) describes a network-reachable, low-complexity attack requiring only low privileges and no user interaction, yielding full confidentiality, integrity, and availability impact - consistent with the CWE-94 code-injection/SSTI-to-RCE nature of the flaw. The strongest escalating signal is that public exploit code exists (POC=YES), with two referenced write-ups describing the technique, which lowers the barrier to opportunistic abuse. Tempering factors: this is NOT in CISA KEV (no confirmed active exploitation), and no EPSS probability was supplied in the input, so widespread automated exploitation cannot be asserted. One nuance to verify: although the vector encodes PR:L, the description specifies the attacker must hold permission to create or modify an Address Template - a relatively privileged administrative capability in ERPNext - so in hardened deployments the effective privilege bar may be closer to PR:H than PR:L; the 8.8 score may slightly overstate risk where Address Template editing is tightly restricted. No SSVC decision data was provided in the input. Net: treat as a priority patch for internet-exposed or multi-tenant ERPNext instances, but realistic exploitation depends on how loosely the Address Template permission is granted. |
| Exploit ScenarioDerived | An authenticated ERPNext user who has been granted permission to edit Address Templates injects a malicious Jinja2 expression (e.g., leveraging frappe.db.sql exposed through get_safe_globals()) into a template's field, then creates an Address document whose country matches that template. When get_address_display is invoked via the API with address_dict set to the address name, frappe.render_template() evaluates the attacker's payload, resulting in server-side code execution or database information disclosure. Public proof-of-concept write-ups documenting this chain already exist, reducing 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 server-side template injection in Frappe ERPNext through 15.89.0 lets a user who can create or modify an Address Template inject arbitrary Jinja expressions that get_address_display later renders, yielding server-side code execution or database information disclosure. The root cause is that ERPNext's custom Jinja2 SandboxedEnvironment still exposes dangerous callables such as frappe.db.sql through get_safe_globals(), and the issue carries a CVSS v3.1 base score of 8.8 (AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H). Publicly available exploit code exists, and although exploitation requires an authenticated account holding the administrative-level Address Template write permission plus the ability to create an Address document with a matching country and call get_address_display with address_dict set to that document's name, the resulting impact on confidentiality, integrity, and availability is high.
RemediationAI
No vendor-released patch identified at time of analysis, and no fixed version number appears anywhere in the provided references, so remediation must begin with removing the attack prerequisites rather than relying on an upgrade. The most effective compensating control is to restrict the Address Template doctype's create and write permissions to a small set of trusted administrators and to audit those permissions across roles, since the core prerequisite of this exploit is authenticated template-write access; the trade-off is operational, because legitimate localization or branding changes to address layouts will then funnel through that narrower group. In parallel, audit existing Address Template records and the template field for suspicious Jinja constructs such as references to frappe., get_safe_globals, import, or dunder attributes, and review logs for get_address_display calls where address_dict is passed as a document name rather than a dictionary, since those are the trigger conditions; expect some false positives from legitimate customized templates. Where custom hardening is feasible, override the Jinja environment's safe-globals list to strip callables like frappe.db.sql, accepting that any in-house template legitimately depending on those callables will break and must be rewritten. Network-layer filtering of template-injection payloads at the WAF can add friction but is easily bypassed by encoding variations, so it should be treated as supplementary only. Monitor the ERPNext project's releases for a version above 15.89.0 that addresses this issue and upgrade as soon as one is published.
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
The vulnerability is an instance of CWE-94 (Improper Control of Generation of Code, i.e. code injection) realized as server-side template injection in Frappe ERPNext. ERPNext's get_address_display method renders address layouts with frappe.render_template(), taking a context derived from the address_dict parameter, which may be either a dictionary or a string naming an Address document; when a string is supplied, the referenced Address document's country selects the Address Template whose template field is rendered. Although ERPNext ships a custom Jinja2 SandboxedEnvironment intended to block dangerous operations, that environment's get_safe_globals() still whitelists powerful framework callables such as frappe.db.sql, so an attacker who can write to an Address Template can place arbitrary Jinja expressions in the template field and have them evaluated server-side under the application's context. The provided CPE entry, cpe:2.3:a:frappe:erpnext:*:*:*:*:*:*:*:*, is version-wildcarded across the Frappe ERPNext product, which aligns with the stated affected range of versions through 15.89.0. Successful exploitation therefore depends on chaining three primitives: Template write access, controllable render context via a crafted Address document, and an unblocked dangerous global reachable from the sandbox.
Know when Frappe 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 reachable (AV:N) with no user interaction and low complexity; PR:L reflects a required but grantable permission, though PR:H is defensible if Address Template editing is admin-only; SSTI yields full RCE/data impact.
Primary rating from NVD.
CVSS VectorNVD
DescriptionNVD
An SSTI (Server-Side Template Injection) vulnerability exists in the get_address_display method of Frappe ERPNext through 15.89.0. This function renders address templates using frappe.render_template() with a context derived from the address_dict parameter, which can be either a dictionary or a string referencing an Address document. Although ERPNext uses a custom Jinja2 SandboxedEnvironment, dangerous functions like frappe.db.sql remain accessible via get_safe_globals(). An authenticated attacker with permission to create or modify an Address Template can inject arbitrary Jinja expressions into the template field. By creating an Address document with a matching country, and then calling the get_address_display API with address_dict="address_name", the system will render the malicious template using attacker-controlled data. This leads to server-side code execution or database information disclosure.
Executive ViewAI
Frappe ERPNext deployments running versions through 15.89.0 are affected by a high-severity authenticated server-side template injection vulnerability that can lead to server-side code execution or exposure of database information. Because publicly available exploit code exists and the flaw requires an account with Address Template write permission, leadership should treat this as an elevated risk to ERPNext data confidentiality, integrity, and availability, especially where administrative access is broadly assigned.
No vendor-released patch identified at time of analysis. Interim mitigations: restrict Address Template write permission and Address document creation to essential trusted administrators; temporarily disable custom Address Template functionality if business processes allow; monitor and alert on Address Template changes and get_address_display calls; apply WAF/virtual patching rules to block suspicious Jinja expressions; audit administrative accounts and review logs for indicators of exploitation.
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
An SQL injection vulnerability exists in the frappe.desk.reportview.get functionality of ERPNext 11.1.38. Rated high sev
Arbitrary file read in the Frappe full-stack web application framework allows remote unauthenticated attackers to retrie
SQL injection in Frappe HelpDesk 1.14.0 dashboard functionality allows authenticated attackers to execute arbitrary SQL
In Frappe ERPNext 15.57.5, the function get_rfq_containing_supplier() at erpnext/buying/doctype/request_for_quotation/re
In Frappe ERPNext 15.57.5, the function get_stock_balance_for() at erpnext/stock/doctype/stock_reconciliation/stock_reco
NVD
CVE.org
EPSS
GitHub PoC
Exploit-DB