Skip to main content

Frappe ERPNext CVE-2025-66436

MEDIUM
Code Injection (CWE-94)
2025-12-15 cve@mitre.org
4.3
CVSS 3.1 · NVD
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Authenticate with Terms and Conditions access
  2. Exploit
    Inject Jinja2 payload into terms field
  3. Execution
    Trigger render via get_terms_and_conditions
  4. Impact
    Call 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.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
No patch listed yet 0.3% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – 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

NVD PRIMARY 4.3 MEDIUM
AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N
vuln.today AI 6.5 MEDIUM

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.

3.1 AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N
4.0 AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N

Primary rating from NVD.

CVSS VectorNVD

Attack Vector
Network
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
None
Availability
None

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

EPSS Score
0.3%
Top 75% exploitable
Prevalence
Medium
popular open-source ERP, broadly used by SMBs but not ubiquitous infrastructure
Exploit
POC
Public exploit code exists
Data Quality
2 sources
Confidence: Low

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.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC Yes
EPSS 0.3%
Patch available No
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
Poc
System Exposure· derived
Open
Automatable· derived
No
Human Impact· derived
Medium

Priority Score

42
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +22
PoC: +20
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Code Injection CRITICAL

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

cpe:2.3:a:frappe:erpnext:*:*:*:*:*:*:*:*
CVE-2025-67289 CRITICAL POC
9.6 Dec 22

Stored cross-site scripting leading to code execution in Frappe Framework 15.89.0 (and the ERPNext application built on

CVE-2018-3885 HIGH POC
8.8 Sep 12

An exploitable SQL injection vulnerability exists in the authenticated part of ERPNext v10.1.6. Rated high severity (CVS

CVE-2018-3884 HIGH POC
8.8 Sep 12

An exploitable SQL injection vulnerability exists in the authenticated part of ERPNext v10.1.6. Rated high severity (CVS

CVE-2018-3883 HIGH POC
8.8 Sep 12

An exploitable SQL injection vulnerability exists in the authenticated part of ERPNext v10.1.6. Rated high severity (CVS

CVE-2018-3882 HIGH POC
8.8 Sep 12

An exploitable SQL injection vulnerability exists in the authenticated part of ERPNext v10.1.6. Rated high severity (CVS

CVE-2025-66440 HIGH POC
8.8 Dec 15

Authenticated SQL injection in Frappe ERPNext through 15.89.0 allows low-privilege users to extract arbitrary database c

CVE-2025-66439 HIGH POC
8.8 Dec 15

SQL injection in Frappe ERPNext through 15.89.0 lets an authenticated attacker with a valid session and access to the Pa

CVE-2025-66438 HIGH POC
8.8 Dec 15

Authenticated attackers with permission to create or modify Print Format documents in Frappe ERPNext through 15.89.0 can

CVE-2025-66437 HIGH POC
8.8 Dec 15

Authenticated server-side template injection in Frappe ERPNext through 15.89.0 lets a user who can create or modify an A

CVE-2025-66434 HIGH POC
8.8 Dec 15

Authenticated server-side template injection in Frappe ERPNext through 15.89.0 allows users with privileges to configure

CVE-2020-6145 HIGH POC
8.8 Aug 10

An SQL injection vulnerability exists in the frappe.desk.reportview.get functionality of ERPNext 11.1.38. Rated high sev

CVE-2023-54345 HIGH POC
8.7 May 05

Frappe Framework ERPNext 13.4.0 contains a sandbox escape vulnerability in RestrictedPython that allows authenticated us

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy