CVE-2026-18632

langgenius dify Jinja2 jinja2_transformer.py jinja2.Template special elements used in a template engine

Published Aug 3, 2026 CVSS 4.0 · 5.3 Medium EPSS < 1% KEV · Not listed
Description
A security flaw has been discovered in langgenius dify up to 1.14.2. This issue affects the function jinja2.Template of the file api/core/helper/code_executor/jinja2/jinja2_transformer.py of the component Jinja2 Handler. The manipulation results in improper neutralization of special elements used in a template engine. The attack may be launched remotely. The exploit has been released to the public and may be used for attacks. The vendor was contacted early about this disclosure but did not respond in any way.

Analysis

AI-generated

Technical impact

Langgenius Dify version 1.14.2 contains a flaw in the jinja2.Template function within the Jinja2 Handler that fails to properly neutralize special elements used in template rendering. This weakness can be exploited remotely to inject template code, potentially allowing an attacker to execute arbitrary code or manipulate the application logic. The issue is associated with CWE‑1336 (Code Injection) and CWE‑791 (Uncontrolled Refraction) and has a CVSS score of 5.3, indicating a moderate severity but with a clear path to compromise the affected host.

Affected Systems

The vulnerability affects the Langgenius Dify product, specifically all releases up to and including 1.14.2. No other vendors or versions are listed in the available data.

Risk and Exploitability

The exploit is publicly available and the vendor has not responded to disclosure, suggesting the flaw may already be in the wild. With a CVSS score of 5.3 and no EPSS data, the likelihood of a targeted attack is uncertain but the vulnerability is exploitable via any exposed API that processes user-supplied template content. The vulnerability is not listed in the CISA KEV catalog, yet its remote nature and available exploitation code increase the practical risk for running systems.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade Langgenius Dify to version 1.15 or later where the Jinja2 template handling is fixed
  • If an immediate upgrade is not possible, restrict the use of the template engine to a whitelist of trusted templates and disable user-supplied template rendering
  • Apply strict input validation and escaping to all data injected into Jinja2 templates to prevent injection of special elements
  • Monitor API logs for attempts to inject template syntax and block suspicious activity

Generated by OpenCVE AI on August 4, 2026 at 09:54 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
Description A security flaw has been discovered in langgenius dify up to 1.14.2. This issue affects the function jinja2.Template of the file api/core/helper/code_executor/jinja2/jinja2_transformer.py of the component Jinja2 Handler. The manipulation results in improper neutralization of special elements used in a template engine. The attack may be launched remotely. The exploit has been released to the public and may be used for attacks. The vendor was contacted early about this disclosure but did not respond in any way.
Title langgenius dify Jinja2 jinja2_transformer.py jinja2.Template special elements used in a template engine
First Time appeared Langgenius
Langgenius dify
Weaknesses CWE-1336
CWE-791
CPEs cpe:2.3:a:langgenius:dify:*:*:*:*:*:*:*:*
Vendors & Products Langgenius
Langgenius dify
References
Metrics cvssV2_0

{'score': 6.5, 'vector': 'AV:N/AC:L/Au:S/C:P/I:P/A:P/E:POC/RL:ND/RC:UR'}

cvssV3_0

{'score': 6.3, 'vector': 'CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L/E:P/RL:X/RC:R'}

cvssV3_1

{'score': 6.3, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L/E:P/RL:X/RC:R'}

cvssV4_0

{'score': 5.3, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N/E:P'}

Weaknesses
  • CWE-1336

    Improper Neutralization of Special Elements Used in a Template Engine

  • CWE-791

    Incomplete Filtering of Special Elements

Sources

Status
PUBLISHED
Assigner
VulDB
Published
Updated
Aug 3, 2026, 9:19 PM
Reserved
Aug 3, 2026, 9:41 AM
Status
Deferred
Published
Aug 3, 2026, 8:17 PM
Modified
Oct 23, 2026, 9:10 PM