CVE-2026-31233: Guardrails AI contains a code injection vulnerability in its Hub package installation mechanism
Guardrails AI 0.6.7 and earlier runs a script named in a Hub package manifest when you run guardrails hub install. A malicious validator package can execute arbitrary code on the installing machine. No patched version is listed yet.
Published May 12, 2026 · Updated Oct 27, 2026 · Analysis Oct 27, 2026
What an attacker can do
guardrails hub install fetches a manifest from the Guardrails Hub and executes the script named in its post_install field. The script path is built from manifest data with no validation or sanitization (CWE-94). Whoever controls the manifest decides what runs.
The attacker must be able to publish a package to the Hub, or tamper with a manifest in transit or at the source. They then wait for a developer or CI job to install it. The code runs with the rights of the installing user, so it can read source, environment variables, API keys and cloud credentials, and plant persistence. NVD rates it 9.8 with no interaction, since the install command itself triggers the script.
Teams most exposed are those that install community validators in build pipelines or on developer laptops next to AI agents. A Hub validator looks like a normal dependency, so the post_install step may go unreviewed. The sources do not describe any in-the-wild use.
Who is affected
pip package guardrails-ai, version 0.6.7 and earlier. Check:
pip show guardrails-aiThe exposure is the guardrails hub install command. Projects that never install Hub validators are not on this path. List the validators you installed with guardrails hub list if your version provides it, and review each one.
guardrails-ai
- Ecosystem
- PyPI
- Affected
- <= 0.6.7
- Fixed in
- No patched version yet
- Check
pip show guardrails-ai
How to fix it
There is no patched version yet. The advisory lists no fix and no workaround.
Until one ships, install Hub validators only from publishers you trust, and read the package manifest and its post_install script before installing. Run installs in an isolated environment or container with no cloud credentials and a minimal environment. Pin validator versions and avoid running hub install in production images or with privileged tokens. Watch the PyPI project page for a release.
How to tell if you were hit
Review shell history and CI logs for guardrails hub install runs and note which packages they pulled. Inspect those packages' post_install scripts for network calls, encoded strings or file writes outside the package. Look for unexpected child processes, outbound connections or new files created during the install window. Rotate credentials that were present in an environment where an unreviewed validator was installed.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
Guardrails AI thru 0.6.7 contains a code injection vulnerability (CWE-94) in its Hub package installation mechanism. When installing validator packages via guardrails hub install, the system retrieves a manifest from the Guardrails Hub and dynamically executes a script specified in the post_install field. The script path is constructed from untrusted manifest data and executed without proper validation or sanitization, allowing remote code execution. An attacker who can publish malicious packages to the Hub can inject arbitrary code that will be executed on any system where a victim installs the malicious package.
Questions
- Is there a patched Guardrails AI version?
Not in the advisory data. 0.6.7 and earlier are listed as vulnerable and no fixed release is named.
- Who can exploit CVE-2026-31233?
Anyone who can publish a malicious package to the Guardrails Hub and gets a victim to install it with guardrails hub install.
- Do I have to run the package to be hit?
No. The post_install script runs during installation itself.
References
Read for this analysis:
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-2024-45858
Guardrails has an arbitrary code execution vulnerability
high8.8Sep 18, 2024CVE-2024-6961
Guardrails AI vulnerable to Improper Restriction of XML External Entity Reference
high5.9Jul 21, 2024
