CVE-2024-6961: Guardrails AI vulnerable to Improper Restriction of XML External Entity Reference
Guardrails AI before 0.5.0 parses RAIL documents with an XML parser that resolves external entities. A RAIL file from an untrusted source can read local files through a SYSTEM entity, and the content shows up in the validated output. Upgrade guardrails-ai to 0.5.0.
Published Jul 21, 2024 · Updated Nov 18, 2024 · Analysis Nov 10, 2026
What an attacker can do
RAIL is Guardrails' XML format for checking LLM output. JFrog's proof of concept is a RAIL document with a DOCTYPE that defines an external entity pointing to file:///etc/passwd, then references it inside the prompt element. Loading it with Guard.from_rail_string and running the guard returns the file's contents in the output (CWE-611).
The attacker needs the application to consume a RAIL document they control, for example a spec uploaded by a user or pulled from an external source. The result is disclosure of files the Python process can read: configuration, keys, environment dumps. The CVSS vector rates attack complexity high and confidentiality impact high, with no integrity or availability effect. Apps that only load RAIL files they wrote are not exposed.
Who is affected
guardrails-ai below 0.5.0. Check:
pip show guardrails-aiThen search your code for Guard.from_rail and Guard.from_rail_string calls, and check whether any of those inputs come from outside your team.
guardrails-ai
- Ecosystem
- PyPI
- Affected
- < 0.5.0
- Fixed in
- 0.5.0
- Check
pip show guardrails-ai
How to fix it
Upgrade to guardrails-ai 0.5.0 or later:
pip install --upgrade "guardrails-ai>=0.5.0"The upstream fix is PR 922 in the guardrails repository (commit f3d806a). JFrog lists no other mitigation, other than not loading RAIL documents from untrusted sources until you upgrade.
How to tell if you were hit
Search RAIL documents and stored specs for DOCTYPE and ENTITY declarations with SYSTEM identifiers that point to local files or remote hosts. Look in output logs for file content, such as passwd lines, appearing in guard results. Check application logs for RAIL documents supplied by users or fetched from external URLs.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
RAIL documents are an XML-based format invented by Guardrails AI to enforce formatting checks on LLM outputs. Guardrails users that consume RAIL documents from external sources are vulnerable to XXE, which may cause leakage of internal file data via the SYSTEM entity.
Questions
- Which version fixes CVE-2024-6961?
guardrails-ai 0.5.0. Everything below it is affected.
- What can be read?
Any file the Python process can read. JFrog's example reads /etc/passwd and returns it in the validated output.
- Am I safe if I only use my own RAIL files?
The risk is documents from untrusted sources. Upgrading removes it either way.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology
More Guardrails AI vulnerabilities
All Guardrails AI entriesCVE-2026-45758
Malicious code in guardrails-ai 0.10.1 (supply chain compromise)
critical9.6No fixMay 19, 2026CVE-2026-31233
Guardrails AI contains a code injection vulnerability in its Hub package installation mechanism
critical9.8No fixMay 12, 2026CVE-2024-45858
Guardrails has an arbitrary code execution vulnerability
high8.8Sep 18, 2024
