CVE-2026-45312 RAGFlow: Server-Side Template Injection in Prompt Generator leads to Remote Code Execution

Critical 9.9 Published Updated

Authenticated users can execute arbitrary OS commands via Jinja2 template injection in the prompt generator, requiring an upgrade to secure the RAGFlow engine.

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-2026-45312?

CVE-2026-45312 is a critical code injection vulnerability in infiniflow ragflow, published on 29 May 2026. Any signed-in user can exploit it over the network, with no action from the victim.

Official description

RAGFlow is an open-source RAG (Retrieval-Augmented Generation) engine. In 0.24.0 and earlier, a Jinja2 template injection in the prompt generator (rag/prompts/generator.py) allows any authenticated user to execute arbitrary OS commands on the server. Any normal user can register, create a Canvas workflow with a DuckDuckGo + LLM component chain, and trigger the SSTI.

Weakness: CWE-1336

Which versions are affected by CVE-2026-45312?

How do I fix CVE-2026-45312?

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

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

Sources

Also known as GHSA-wpg4-h5g2-jxm6.

Is CVE-2026-45312 in your software?

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

Check your SBOMs for free