Cyber Posture

CVE-2025-66437

HighPublic PoC

Published: 15 December 2025

Published
15 December 2025
Modified
05 January 2026
KEV Added
Patch
CVSS Score 8.8 CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
EPSS Score 0.0015 34.7th percentile
Risk Priority 18 60% EPSS · 20% KEV · 20% CVSS

Description

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…

more

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.

Mitigating Controls (NIST 800-53 r5)AI

prevent

Validates and sanitizes user-supplied template expressions and address_dict parameters to prevent SSTI exploitation in frappe.render_template().

prevent

Configures the Jinja2 SandboxedEnvironment to the least functionality by prohibiting dangerous functions like frappe.db.sql in get_safe_globals(), blocking code execution even if injection occurs.

preventrecover

Remediates the flaw in get_address_display by patching the insecure rendering of Address Templates with attacker-controlled data.

Security SummaryAI

CVE-2025-66437 is a Server-Side Template Injection (SSTI) vulnerability in the get_address_display method of Frappe ERPNext through version 15.89.0. This method 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 employs a custom Jinja2 SandboxedEnvironment, dangerous functions such as 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. The attacker can then create an Address document with a matching country and invoke the get_address_display API endpoint using address_dict set to the address name string. This causes the system to render the malicious template with attacker-controlled data, resulting in server-side code execution or database information disclosure. The vulnerability 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) and maps to CWE-94 and CWE-1336.

Advisories providing additional details on the vulnerability are available at https://iamanc.github.io/post/erpnext-ssti-bug-4 and https://www.notion.so/SSTI-bug-4-239e6086eadc80aa9331fba874c674a5?source=copy_link.

Details

CWE(s)

Affected Products

frappe
erpnext
≤ 15.89.0

MITRE ATT&CK Enterprise TechniquesAI

T1190 Exploit Public-Facing Application Initial Access
Adversaries may attempt to exploit a weakness in an Internet-facing host or system to initially access a network.
T1221 Template Injection Stealth
Adversaries may create or modify references in user document templates to conceal malicious code or force authentication attempts.
T1068 Exploitation for Privilege Escalation Privilege Escalation
Adversaries may exploit software vulnerabilities in an attempt to elevate privileges.
Why these techniques?

SSTI in web application enables exploitation of public-facing application (T1190) via template injection (T1221), leading to RCE and potential privilege escalation (T1068).

Confidence: HIGH · MITRE ATT&CK Enterprise v19.0

References