Skip to main content

Frappe ERPNext CVE-2025-66437

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

Attack ChainAIDerived

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

  1. Access
    Authenticate with Address Template edit rights
  2. Delivery
    Inject Jinja payload into template field
  3. Exploit
    Create Address with matching country
  4. Execution
    Call get_address_display API (address_dict=address_name)
  5. Persist
    render_template executes payload in sandbox
  6. Impact
    Code 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.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
No patch listed yet 0.6% exploitation probability (EPSS)

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

Alert me

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

NVD PRIMARY 8.8 HIGH
AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
vuln.today AI 8.8 HIGH

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.

3.1 AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
4.0 AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/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
High
Integrity
High
Availability
High

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

Why It Matters

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.

Business Impact: High
Compensating Controls

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

EPSS Score
0.6%
Top 53% exploitable
Prevalence
Medium
popular open-source ERP, common in 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 HIGH
CISA KEV No
Public POC Yes
EPSS 0.6%
Patch available No
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.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
High

Priority Score

65
Low Medium High Critical
KEV: 0
EPSS: +1
CVSS: +44
PoC: +20
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.

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:*:*:*:*:*:*:*:*

More in Frappe

View all
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-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-2026-39352 HIGH POC
8.7 May 20

Arbitrary file read in the Frappe full-stack web application framework allows remote unauthenticated attackers to retrie

CVE-2025-10655 HIGH POC
8.6 Dec 09

SQL injection in Frappe HelpDesk 1.14.0 dashboard functionality allows authenticated attackers to execute arbitrary SQL

CVE-2025-52042 HIGH POC
8.2 Oct 01

In Frappe ERPNext 15.57.5, the function get_rfq_containing_supplier() at erpnext/buying/doctype/request_for_quotation/re

CVE-2025-52041 HIGH POC
8.2 Oct 01

In Frappe ERPNext 15.57.5, the function get_stock_balance_for() at erpnext/stock/doctype/stock_reconciliation/stock_reco

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