CVE-2025-66435 Code injection in n/a

Medium 4.3 Published Updated

Authenticated attackers can execute arbitrary code and leak database information by injecting Jinja2 templates into contract terms in ERPNext.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Over the internet
Victim action needed
Not needed
Fix
None listed

What is CVE-2025-66435?

CVE-2025-66435 is a medium-severity code injection vulnerability in Frappe Erpnext, published on 15 Dec 2025. Any signed-in user can exploit it over the network, with no action from the victim.

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

Weakness: CWE-94, CWE-1336

Which versions are affected by CVE-2025-66435?

It affects 1 product.

Products include Frappe Erpnext.

How do I fix CVE-2025-66435?

No fix has been published for CVE-2025-66435 yet. Limit exposure of the affected software until one is available.

Upgrade, and never evaluate templates, expressions or code built from user input. More about Code injection.

Is CVE-2025-66435 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-66435 exists.

All Frappe Erpnext vulnerabilities

Sources

Also known as GHSA-hc98-xxm8-jfgj.

Is CVE-2025-66435 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free