4.3medium
An SSTI (Server-Side Template Injection) vulnerability exists in the getcontracttemplate method of Frappe ERPNext through 15.89.0.
- Severity
- 4.3medium CVSS:3.1 by CISA-ADP
- Exploit likelihood
- 0.36% (higher than 31% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- mitre
Description
An SSTI (Server-Side Template Injection) vulnerability exists in the get_contract_template method of Frappe ERPNext through 15.89.0. The function renders attacker-controlled Jinja2 templates (contract_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 Contract Template can inject arbitrary Jinja expressions into the contract_terms field, resulting in server-side code execution within a restricted but still unsafe context. This vulnerability can be used to leak database information.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Unspecified product | n/a | CVE List |
| frappe erpnext | up to 15.89.0 | NVD |
All scores
| CISA-ADP | 4.3medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N |
| NVD | 4.3medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N |
Classification
What each source says
CVE List
An SSTI (Server-Side Template Injection) vulnerability exists in the get_contract_template method of Frappe ERPNext through 15.89.0. The function renders attacker-controlled Jinja2 templates (contract_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 Contract Template can inject arbitrary Jinja expressions into the contract_terms field, resulting in server-side code execution within a restricted but still unsafe context. This vulnerability can be used to leak database information.
NVD (es)
Una vulnerabilidad SSTI (Server-Side Template Injection) existe en el método get_contract_template de Frappe ERPNext hasta la versión 15.89.0. La función renderiza plantillas Jinja2 controladas por el atacante (contract_terms) usando frappe.render_template() con un contexto proporcionado por el usuario (doc). Aunque Frappe usa un SandboxedEnvironment personalizado, varias globales peligrosas como frappe.db.sql todavía están disponibles en el contexto de ejecución a través de get_safe_globals(). Un atacante autenticado con acceso para crear o modificar una Plantilla de Contrato puede inyectar expresiones Jinja arbitrarias en el campo contract_terms, resultando en ejecución de código del lado del servidor dentro de un contexto restringido pero aún inseguro. Esta vulnerabilidad puede ser usada para filtrar información de la base de datos.
References
| https://www.notion.so/SSTI-bug-2-239e6086eadc80878e8fcc7b6c26a584?source=copy_link | exploit, third-party-advisory | |
| https://iamanc.github.io/post/erpnext-ssti-bug-2 | exploit, third-party-advisory | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2025-66435 changed 2025-12-17 | CVE Terms of Use |
| NVD | CVE-2025-66435 changed 2026-10-14 | Public domain |