CVE-2025-66436 Code injection in n/a

Medium 4.3 Published Updated

Authenticated attackers can inject Jinja templates in ERPNext terms to execute code and leak database information.

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-66436?

CVE-2025-66436 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_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.

Weakness: CWE-94, CWE-1336

Which versions are affected by CVE-2025-66436?

It affects 1 product.

Products include Frappe Erpnext.

How do I fix CVE-2025-66436?

No fix has been published for CVE-2025-66436 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-66436 being exploited?

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

All Frappe Erpnext vulnerabilities

Sources

Also known as GHSA-mc79-8xp6-rcw8.

Is CVE-2025-66436 in your software?

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

Check your SBOMs for free