# CVE-2026-18632: LangGenius Dify server-side template injection in Jinja2 handler

Source: https://junglewise.ai/threats/cve-2026-18632-langgenius-dify-server-side-template-injection-in-jinja2-handler  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-08-03. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

CVE-2026-18632 · Severity: medium · CVSS 6.3 · Published 2026-08-03

Dify, a popular open-source LLM application framework, contains a server-side template injection vulnerability in its Jinja2 code executor. An authenticated attacker can inject malicious templates through workflow nodes or APIs to achieve remote code execution and data exfiltration. The vulnerability exists because the code uses an unsandboxed Jinja2 template engine instead of applying proper sandboxing controls.

Technologies: [Langgenius Dify](https://junglewise.ai/threats/technologies/dify). Vendors: [Langgenius](https://junglewise.ai/threats/vendors/langgenius).

## Quick answers

**Is CVE-2026-18632 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-18632 being exploited in the wild.

**How severe is CVE-2026-18632?** Medium severity, with a CVSS score of 6.3, published 3 August 2026.

**Which products and versions are affected?** Langgenius Dify up to 1.14.2.

**Is there a fix for CVE-2026-18632?** No fixed version is recorded yet. Check the vendor's advisory in the references below. If you run it, Junglewise drafts a mitigation that fits your setup and applies it once you approve, with senior security engineers behind it.

**How is CVE-2026-18632 attacked?** It is attacked over the network.

**Am I affected by CVE-2026-18632?** Check whether you run Langgenius Dify at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## Technical details

The vulnerability is a server-side template injection (SSTI) in the Jinja2 handler component at api/core/helper/code_executor/jinja2/jinja2_transformer.py. The vulnerable code instantiates jinja2.Template() directly on user-controlled input rather than using jinja2.sandbox.SandboxedEnvironment(), which is correctly deployed elsewhere in the same codebase. An authenticated attacker can inject malicious Jinja2 templates via workflow code nodes or API endpoints to traverse Python object introspection (__class__, __mro__, __subclasses__) and achieve arbitrary code execution. The attack requires authentication but no additional preconditions; exploits are publicly available and weaponized in the wild.

## Affected products

- LangGenius Dify up to 1.14.2

## Timeline

- 2026-06-09: disclosed: Public disclosure via GitHub issue by CVE-Hunter-Leo
- 2026-08-03: advisory: CVE-2026-18632 published; vendor did not respond to early disclosure
- 2026-06-09: exploited: Proof-of-concept exploit released publicly

## References

- [https://github.com/CVE-Hunter-Leo/CVE/issues/14](https://github.com/CVE-Hunter-Leo/CVE/issues/14)
- [https://vuldb.com/cve/CVE-2026-18632](https://vuldb.com/cve/CVE-2026-18632)

## Related threats

- [langgenius dify hard-coded credentials in sandbox](https://junglewise.ai/threats/cve-2026-123135-a-vulnerability-was-found-in-langgenius-dify-up-to-1-18-0-2-0-0)
- [Dify authorization bypass in MCP server endpoint](https://junglewise.ai/threats/cve-2026-105761-dify-is-an-open-source-llm-app-development-platform-prior-to-1)
- [langgenius dify DOM-based XSS in redirect URL handler](https://junglewise.ai/threats/cve-2026-85022-langgenius-dify-dom-based-xss-in-redirect-url-handler)
- [langgenius Dify DOM-based XSS in splash.tsx redirect](https://junglewise.ai/threats/cve-2026-85021-langgenius-dify-dom-based-xss-in-splash-tsx-redirect)
- [LangGenius Dify open redirect in AppInitializer OAuth flow](https://junglewise.ai/threats/cve-2026-18266-langgenius-dify-open-redirect-in-appinitializer-oauth-flow)
