CVE-2025-66436 Details
Description
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.
A server-side template injection (SSTI) vulnerability has been identified in Frappe ERPNext versions through 15.89.0. The issue arises in the 'get_terms_and_conditions' method, where user-controlled Jinja2 templates are rendered using 'frappe.render_template()' with a context that can be manipulated by the user. Despite Frappe's use of a custom SandboxedEnvironment, several dangerous globals, including 'frappe.db.sql', are accessible via 'get_safe_globals()', allowing for potential exploitation. An authenticated attacker with the ability to create or modify Terms and Conditions documents can inject arbitrary Jinja expressions into the terms field, leading to unauthorized code execution on the server side within a limited but still risky context. This vulnerability could also be exploited to extract sensitive information from the database.
Metrics
CVSS 4.0 Severity and Vector Strings:
No CVSS 4.0 data is available for this CVE.
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
CISA-ADP
Assessed Dec 16, 2025References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| https://iamanc.github.io/post/erpnext-ssti-bug-3 | [email protected] | ExploitThird Party Advisory |
| https://www.notion.so/SSTI-bug-3-239e6086eadc8020aeecdaf123e32f3d?source=copy_link | [email protected] | ExploitThird Party Advisory |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-94 | Improper Control of Generation of Code ('Code Injection') | [email protected] |
| CWE-1336 | Improper Neutralization of Special Elements Used in a Template Engine | CISA-ADP |
Affected Products
| Product | Versions |
|---|---|
| frappe erpnext | <= 15.89.0 |
CPE
Remediation
| |
Change History
7 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Jun 17, 2026 | CVE Modified | CISA-ADP |
| Jun 17, 2026 | CVE Modified | [email protected] |
| Dec 23, 2025 | Reanalysis | [email protected] |
| Dec 23, 2025 | Initial Analysis | [email protected] |
| Dec 17, 2025 | CVE Modified | CISA-ADP |
| Dec 16, 2025 | CVE Modified | CISA-ADP |
| Dec 15, 2025 | New CVE Received | [email protected] |