{"id":"CVE-2025-66435","aliases":["CVE-2025-66435"],"related":[],"kind":"vulnerability","state":"published","title":"An SSTI (Server-Side Template Injection) vulnerability exists in the getcontracttemplate method of Frappe ERPNext through 15.89.0.","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"es","text":"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.","source":"nvd"}],"published":"2025-12-15T00:00:00.000Z","modified":"2026-10-14T13:10:00.187Z","severity":{"scorer":"CISA-ADP","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N","score":4.3,"rating":"MEDIUM"},"severities":[{"scorer":"CISA-ADP","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N","score":4.3,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N","score":4.3,"rating":"MEDIUM"}],"cwes":["CWE-94","CWE-1336"],"affected":[{"ranges":[{"version":"n/a","status":"affected"}],"source":"cvelist"},{"ranges":[{"status":"affected","lastAffected":"15.89.0"}],"vendor":"frappe","product":"erpnext","cpe":"cpe:2.3:a:frappe:erpnext:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://www.notion.so/SSTI-bug-2-239e6086eadc80878e8fcc7b6c26a584?source=copy_link","tags":["exploit","third-party-advisory"],"sources":["cvelist","nvd"]},{"url":"https://iamanc.github.io/post/erpnext-ssti-bug-2","tags":["exploit","third-party-advisory"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"mitre","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2025-12-16T18:44:07.911Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-66435","url":"https://www.cve.org/CVERecord?id=CVE-2025-66435","licence":"CVE Terms of Use","modified":"2025-12-17T15:50:42.517Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-66435","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-66435","licence":"Public domain","modified":"2026-10-14T13:10:00.187Z"}],"updatedAt":"2026-11-25T22:59:09.412Z","epss":{"score":0.00361,"percentile":0.3188,"date":"2026-12-01T12:00:22.000Z"}}