CVE-2025-66435
JSON

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 packageVersionsReported by
Unspecified productn/aCVE List
frappe erpnextup to 15.89.0NVD

All scores

CISA-ADP4.3medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N
NVD4.3medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N

Classification

CWE-94CWE-1336

SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial.

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

Sources

SourceRecordLicence
CVE ListCVE-2025-66435 changed 2025-12-17CVE Terms of Use
NVDCVE-2025-66435 changed 2026-10-14Public domain