CWE-1336Weakness · CWE-1336

CVE-2026-45312

CRITICAL · 9.9 CVSS v3.1 Published 2026-05-29
Mitigation only
No fix yet — a mitigation exists. There is no fixed release. A documented workaround reduces exposure in the meantime.
See remediation →
100/100
Remediation priority · Urgent
Remotely reachable Zero-click

Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.

NVD · unedited
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.

Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.

dbcve analysis · high confidence

A Server-Side Template Injection (SSTI) vulnerability in RAGFlow 0.24.0 and earlier allows authenticated users to achieve arbitrary OS command execution via Jinja2 template manipulation in the prompt generator (rag/prompts/generator.py). Attackers can register a normal user account, create a Canvas workflow containing a DuckDuckGo + LLM component chain, and inject malicious template syntax to execute commands on the underlying server.

MitigationUpgrade RAGFlow to a version newer than 0.24.0 which patches the template injection. If immediate patching is not feasible, disable new user registration and implement strict input validation or sandboxing on the prompt generator component to block Jinja2 template syntax in user-controlled inputs.

Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.

CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.

From the vector
Attack vector
Network
Complexity
Low
Privileges
Low
User interaction
None
Scope
Changed
Confidentiality
High
Integrity
High
Availability
High

CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H

Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.

dbcve checks

Work through these to decide whether this CVE applies to you.

  1. Determine installed RAGFlow version
    Check the version file or the application UI for the current RAGFlow version. Common locations include: version info in the UI footer, a VERSION file in the installation directory, or the Docker image tag if running in containers.
    Affected if The installed version is 0.24.0 or any version earlier than 0.24.0
  2. Verify the prompt generator file exists
    Inspect the file rag/prompts/generator.py in the RAGFlow installation directory. This file handles Jinja2 template processing for the prompt generator.
    Affected if The file exists and is present in version 0.24.0 or earlier, indicating the vulnerable code path is in place
  3. Check if user registration is enabled
    Review the RAGFlow configuration settings or database for user registration status. Look for settings that allow new user self-registration or invitation-based account creation.
    Affected if User registration or new user invitation is enabled, allowing external attackers to obtain authenticated access
  4. Identify active Canvas workflows with DuckDuckGo and LLM components
    Review the RAGFlow Canvas workflows to identify any active or saved workflows that contain both DuckDuckGo search integration and LLM components, as this combination triggers the vulnerable template processing path.
    Affected if Any Canvas workflow with DuckDuckGo + LLM components exists and is executable by authenticated users
  5. Inspect Jinja2 template usage in prompt generator
    Examine the rag/prompts/generator.py file for direct use of Jinja2 template rendering with user-provided or workflow-derived input without sanitization functions, safe subprocess execution, or sandboxing.
    Affected if The code shows unsanitized Jinja2 template rendering (e.g., Template(...).render() or environment.from_string() called with workflow variable inputs)

A user is affected if RAGFlow version is 0.24.0 or earlier, authenticated user registration is enabled, and Canvas workflows with DuckDuckGo and LLM components are in use, exposing unsanitized Jinja2 template processing.

Generated from the published advisory. Verify against your own configuration.

Check your environment

Paste your version and any relevant configuration and it will be compared against the affected criteria above. Do not include secrets or credentials.

AI-assisted, checked against the advisory. Informational, not a guarantee.

Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.

dbcve · scoped
Mitigation available No clean upgrade yet — mitigate in the meantime
Mitigation

Upgrade RAGFlow to a version newer than 0.24.0 which patches the template injection. If immediate patching is not feasible, disable new user registration and implement strict input validation or sandboxing on the prompt generator component to block Jinja2 template syntax in user-controlled inputs.

Recommended fix Moderate confidence

Latest RAGFlow release newer than 0.24.0 (check GitHub releases for security patches)

  1. 1. Identify the current RAGFlow version by checking the installation or docker image tag
  2. 2. Check the official RAGFlow GitHub repository (github.com/infiniflow/ragflow) for releases newer than 0.24.0 that address this SSTI vulnerability
  3. 3. Upgrade to the latest stable release that contains the security fix for the Jinja2 template injection in rag/prompts/generator.py
  4. 4. After upgrade, verify the fix by ensuring the prompt generator properly sanitizes Jinja2 template inputs
  5. 5. Review user permissions and consider limiting workflow creation capabilities for untrusted users until upgrade is complete
Caveat Minor version upgrades typically have minimal breaking changes, but review release notes for any configuration or API changes

Generated from the published advisory — verify against the referenced sources before acting.

Have this fixed Scoped from the published advisory
  • Consultation3.0 h
  • Implementation6.0 h
  • Testing4.0 h
  • Review / QA3.0 h
16.0 hours of engineering $2,820
Get help mitigating

An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $4,512.

Scan for this in your stack

Free · runs locally
dbcve dependency scanner

Check whether your project pulls in CVE-2026-45312 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.

References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.

Primary sources

Practitioner notes

Contributed

Peer-ranked notes from engineers who’ve handled CVE-2026-45312 in production — separate from our analysis above.

No notes yet

Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.

What this is

A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.

What belongs here
  • Verified mitigations, workarounds, and config changes
  • Version or environment caveats, and links to real fixes
  • No weaponised exploit code, or anything meant to cause harm
  • No spam, self-promotion, credentials, or personal data