Frappe ERPNext CVE-2025-66436
MEDIUMAttack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessAuthenticate with Terms and Conditions access
-
ExploitInject Jinja2 payload into terms field
-
ExecutionTrigger render via get_terms_and_conditions
-
ImpactCall frappe.db.sql to leak database 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 | Exploitation requires an authenticated account whose role has permission to create or modify a Terms and Conditions document in ERPNext (through version 15.89.0); the attacker places a Jinja2 expression in the 'terms' field, which is later rendered by the get_terms_and_conditions method through frappe.render_template(). The key limiting factor is this write privilege - anonymous or read-only users cannot trigger it. Impact is further bounded by Frappe's custom SandboxedEnvironment, which blocks most dangerous operations; the practical attack surface is the subset of dangerous globals still exposed by get_safe_globals() (notably frappe.db.sql), constraining the outcome to database information disclosure rather than arbitrary OS-level code execution. No special non-default server configuration is stated as required. |
| Impact | This is a moderate, authenticated-only information-disclosure flaw rather than a top-tier priority. The CVSS 3.1 vector (AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N, base 4.3) is internally consistent: network-reachable, low complexity, but requiring authenticated privileges (PR:L) and yielding only limited confidentiality impact with no integrity or availability effect. Public exploit code exists (two write-ups referenced), which raises practical risk, but the CVE is NOT in CISA KEV and no EPSS score was supplied, so there is no evidence of active or widespread exploitation - POC availability and active exploitation are distinct signals and only the former is present here. There is tension between the signals and the labeling: the tags claim 'RCE' and the description says 'server-side code execution,' yet the CVSS impact is scoped to C:L/I:N/A:N (database information leakage within a restricted sandbox), so the real-world outcome is data exposure, not full unrestricted code execution - treat the 'RCE' framing with caution. No SSVC decision data was provided. Net: a real but bounded issue best prioritized for internet-exposed ERPNext tenants with untrusted or numerous low-privilege users; not an emergency patch for isolated/internal deployments. |
| Exploit ScenarioDerived | An authenticated ERPNext user who holds permission to create or edit a Terms and Conditions document embeds a malicious Jinja2 expression (e.g. invoking frappe.db.sql) in the terms field. When get_terms_and_conditions renders that template via frappe.render_template() with the doc context, the payload executes inside Frappe's sandboxed environment and reads data the attacker should not see. Publicly available proof-of-concept write-ups demonstrate the technique. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Oct 14, 2026
Server-side template injection (SSTI) in Frappe ERPNext through 15.89.0 allows authenticated users who can create or modify Terms and Conditions documents to execute restricted Jinja2 expressions and leak sensitive database information. Publicly available exploit code exists, and the vulnerability is assessed to have high confidentiality impact (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N) without affecting integrity or availability. Exploitation requires only the inherent document-write privilege, and no non-default server configuration is needed, though the sandboxed environment limits the outcome to database disclosure rather than arbitrary code execution.
RemediationAI
No vendor-released patch has been identified at time of analysis. As an immediate compensating control, restrict the ability to create or modify Terms and Conditions documents to a minimal set of highly trusted roles, and audit existing documents for suspicious Jinja expressions such as those referencing frappe.db.sql. If feasible, modify the get_safe_globals() implementation to remove dangerous globals like frappe.db.sql from the template context, though this requires code changes and testing to avoid breaking legitimate template use. Additionally, consider implementing application-level monitoring or a web application firewall rule to detect and block template injection payloads in the terms field. These mitigations may reduce functionality for legitimate document authors and should be applied with caution. No official advisory URL is available in the provided references; the cited links are third-party exploit write-ups.
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 resides in the get_terms_and_conditions method of Frappe ERPNext, which renders attacker-controlled Jinja2 templates from the 'terms' field using frappe.render_template() with a user-supplied context (doc). Frappe employs a custom SandboxedEnvironment, but the get_safe_globals() function still exposes dangerous globals such as frappe.db.sql, enabling arbitrary SQL queries within the template. This falls under CWE-94 (Code Injection) because the application fails to neutralize special elements in user input before passing it to the template engine. The CPE cpe:2.3:a:frappe:erpnext:*:*:*:*:*:*:*:* indicates all versions through 15.89.0 are affected. While the sandbox blocks most dangerous operations, the exposed database query global is sufficient to exfiltrate information, aligning with the assessed high confidentiality impact and no integrity or availability impact.
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:L/I:N/A:N
Authenticated T&C-edit privilege gives PR:L over the network at low complexity; exposed frappe.db.sql enables arbitrary database reads, so C:H, with no stated integrity or availability impact.
Primary rating from NVD.
CVSS VectorNVD
DescriptionNVD
An SSTI (Server-Side Template Injection) vulnerability exists in the get_terms_and_conditions method of Frappe ERPNext through 15.89.0. The function renders attacker-controlled Jinja2 templates (terms) using frappe.render_template() with a user-supplied context (doc). Although Frappe uses a custom SandboxedEnvironment, several dangerous globals such as frappe.db.sql are still available in the execution context via get_safe_globals(). An authenticated attacker with access to create or modify a Terms and Conditions document can inject arbitrary Jinja expressions into the terms field, resulting in server-side code execution within a restricted but still unsafe context. This vulnerability can be used to leak database information.
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
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 attackers with permission to create or modify Print Format documents in Frappe ERPNext through 15.89.0 can
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
NVD
CVE.org
EPSS
GitHub PoC
Exploit-DB