A Jinja2 template injection vulnerability in RAGFlow's prompt generator allows authenticated users to execute arbitrary OS commands on the server.
Description
A Jinja2 template injection vulnerability in RAGFlow's prompt generator allows authenticated users to execute arbitrary OS commands on the server.
AI Analyst Comment
Remediation
Update Unknown Multiple Products to the latest version. Monitor for exploitation attempts and review access logs.
---METADATA---
VENDOR: RAGFlow
PRODUCT: RAGFlow
AFFECTED_VERSIONS: 0.24.0 and earlier
---END_METADATA---
Description Summary:
A Jinja2 template injection vulnerability in RAGFlow's prompt generator allows authenticated users to execute arbitrary OS commands on the server.
Executive Summary:
An SSTI vulnerability in RAGFlow allows authenticated users to achieve remote code execution via malicious prompt generation workflows.
Vulnerability Details
CVE-ID: CVE-2026-45312
Affected Software: RAGFlow
Affected Versions: 0.24.0 and earlier
Vulnerability: The prompt generator (rag/prompts/generator.py) contains a Jinja2 template injection flaw. Authenticated users can create a specially crafted workflow, such as a Canvas workflow with a DuckDuckGo + LLM component chain, to trigger the injection and execute arbitrary OS commands.
Business Impact
With a CVSS score of 9.9, this vulnerability is critical. While it requires authentication, the ability for any standard user to gain remote code execution on the server poses a significant threat to the platform's security, potentially leading to total system compromise.
Remediation Plan
Immediate Action: Update to the latest version of RAGFlow.
Proactive Monitoring: Monitor server-side logs for unusual process creation or shell command activity originating from the RAGFlow service.
Compensating Controls: Enforce strict controls on user permissions and limit the ability of regular users to create complex workflows or access sensitive prompt generation features.
Exploitation Status
Public Exploit Available: None
Analyst Notes: As of May 29, 2026, there is no public information indicating active exploitation of this vulnerability. However, due to the nature of the flaw, the potential for exploitation is high.
Analyst Recommendation
Organizations should update their RAGFlow installation to the latest available version immediately. Additionally, audit all user-created workflows for suspicious patterns that might indicate an attempt to leverage this injection point.