Skip to main content

Frappe ERPNext CVE-2025-66438

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 Print Format edit permission
  2. Delivery
    Inject Jinja/frappe.db.sql payload into html field
  3. Exploit
    Save malicious Print Format
  4. Execution
    Call get_html_and_style() on target document
  5. Persist
    Server renders template via get_rendered_template()
  6. Impact
    Exfiltrate 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.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
No patch listed yet 0.5% 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 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

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 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.

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

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

Why It Matters

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.

Business Impact: High
Compensating Controls

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

EPSS Score
0.5%
Top 59% exploitable
Prevalence
Medium
popular open-source ERP, common in SMBs but not ubiquitous enterprise-wide
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.5%
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

64
Low Medium High Critical
KEV: 0
EPSS: 0
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:*:*:*:*:*:*:*:*
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-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

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

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