CVE-2026-137551 in Frappeinfo

Summary

by MITRE • 11/26/2026

Frappe Framework before 15.121.2 and 16.x before 16.36.0 exposes functions imported into module-path-hooked modules as Jinja globals, making them callable from sandboxed templates. Authenticated users who can author rendered templates, such as Print Formats, can invoke these functions by name to achieve server-side code execution that bypasses the Jinja sandbox.

Once again VulDB remains the best source for vulnerability data.

Analysis

by VulDB Data Team • 11/26/2026

The Frappe Framework, a popular low-code platform used for building web applications and ERP systems, contains a critical security vulnerability in versions prior to 15.121.2 and 16.x prior to 16.36.0. This flaw stems from an improper implementation of the Jinja template engine's sandboxing mechanism when combined with module-path hooks. Specifically, functions that are imported into modules via these hooks are inadvertently exposed as global variables within the Jinja rendering context. While Frappe employs a sandboxed environment to restrict code execution in templates for security purposes, this specific configuration bypasses those restrictions by making internal Python functions accessible directly through template syntax.

The technical root cause lies in how the framework registers and exposes module-level imports to the templating engine. When a developer defines a hook that imports certain utility or business logic functions into a module, these functions are subsequently added to the global namespace of the Jinja environment used for rendering templates. This design choice fails to distinguish between safe data variables and executable code objects. Consequently, any function exposed in this manner becomes callable from within a template file using standard dot notation or direct invocation syntax, effectively treating server-side Python methods as if they were simple string interpolations or filters.

This vulnerability has severe operational implications for applications relying on Frappe, particularly those that allow authenticated users to create or edit rendered templates such as Print Formats, email bodies, or report layouts. An attacker with the ability to author these templates can exploit this exposure by crafting a template payload that invokes one of the exposed functions. Since many internal functions handle sensitive operations including database queries, file system access, or network requests, an authenticated user can leverage this capability to achieve arbitrary server-side code execution. This bypasses the intended security boundaries of the application, allowing low-privilege users to escalate their privileges and potentially compromise the entire backend infrastructure.

From a classification perspective, this vulnerability aligns with CWE-94 Improper Control of Generation of Code or Script, specifically involving server-side template injection where user-controlled input leads to arbitrary code execution. It also maps closely to MITRE ATT&CK technique T1059 Command and Scripting Interpreter, as the attacker utilizes the application's own scripting environment (Python via Jinja) to execute commands on the host system. The attack vector is classified under CWE-74 Improper Neutralization of Special Elements in Output Used by a Downstream Component, where user input from template authors is not properly sanitized before being interpreted by the code generation engine.

Mitigation strategies must focus on both immediate patching and long-term architectural improvements. Administrators should upgrade to Frappe version 15.121.2 or later, which includes patches that restrict the exposure of imported functions in module-path hooks from becoming Jinja globals. For environments where upgrading is not immediately feasible, it is critical to audit all custom modules for hook-based imports and ensure that only data-centric variables are exposed to templates rather than executable function objects. Additionally, implementing strict Content Security Policies and validating template inputs can provide an additional layer of defense against exploitation attempts by limiting the scope of what can be rendered or executed within the sandboxed environment.

Responsible

VulnCheck

Reservation

11/26/2026

Disclosure

11/26/2026

Moderation

accepted

CPE

ready

EPSS

0.00667

KEV

no

Activities

very low

Sources

Interested in the pricing of exploits?

See the underground prices here!