CVE-2024-45858 Guardrails has an arbitrary code execution vulnerability
Attackers can execute arbitrary code on user machines by tricking them into loading malicious XML files processed by the Guardrails AI framework.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Local or same network only
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is CVE-2024-45858?
CVE-2024-45858 is a high-severity code injection vulnerability in guardrails, published on 18 Sep 2024. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.
Official description
An arbitrary code execution vulnerability exists in versions 0.2.9 up to 0.5.10 of the Guardrails AI Guardrails framework because of the way it validates XML files. If a victim user loads a maliciously crafted XML file containing Python code, the code will be passed to an eval function, causing it to execute on the user's machine.
Weakness: CWE-95
Which versions are affected by CVE-2024-45858?
3 open source packages ship an affected version, including guardrails-ai.
| Package | Affected | Fixed in |
|---|---|---|
guardrails-ai PyPI | From 0.2.9 | 0.5.10 |
guardrails-ai PyPI | From 0.2.9 | 0.5.10 |
guardrails-ai PyPI | From 0.2.9 | 0.5.10 |
How do I fix CVE-2024-45858?
Upgrade guardrails-ai to 0.5.10 or later.
Upgrade, and never evaluate templates, expressions or code built from user input. More about Code injection.
Is CVE-2024-45858 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-45858 exists.
Sources
Also known as GHSA-w392-75q8-vr67, PYSEC-2026-1432.