CVE-2025-66436

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

Configuration 1 (hide)

cpe:2.3:a:frappe:erpnext:*:*:*:*:*:*:*:*

History

14 Oct 2026, 13:10

Type Values Removed Values Added
Summary
  • (es) Una vulnerabilidad SSTI (Server-Side Template Injection) existe en el método get_terms_and_conditions de Frappe ERPNext hasta la versión 15.89.0. La función renderiza plantillas Jinja2 controladas por el atacante ('terms') utilizando frappe.render_template() con un contexto proporcionado por el usuario ('doc'). Aunque Frappe utiliza un SandboxedEnvironment personalizado, varias variables globales peligrosas como frappe.db.sql siguen estando disponibles en el contexto de ejecución a través de get_safe_globals(). Un atacante autenticado con acceso para crear o modificar un documento de Términos y Condiciones puede inyectar expresiones Jinja arbitrarias en el campo 'terms', lo que resulta en la ejecución de código del lado del servidor dentro de un contexto restringido pero aún inseguro. Esta vulnerabilidad puede utilizarse para filtrar información de la base de datos.

Information

Published : 2025-12-15 18:15

Updated : 2026-10-14 13:10


NVD link : CVE-2025-66436

Mitre link : CVE-2025-66436

CVE.ORG link : CVE-2025-66436


JSON object : View

Products Affected

frappe

  • erpnext
CWE
CWE-94

Improper Control of Generation of Code ('Code Injection')

CWE-1336

Improper Neutralization of Special Elements Used in a Template Engine