Vulnerabilities in pkg:pypi/ouroboros-ai

PACKAGE
Advisory Summary

GHSA-jv2h-4p9v-wf5w is a HIGH remote code execution vulnerability (CWE-15: External Control of System or Configuration Setting) affecting ouroboros-ai libraries in the PyPI ecosystem. The issue involves incomplete fix of cve-2026-47211: untrusted project .env can still reach rce via omitted execution-routing keys. Remediation is available by upgrading affected packages to version 0.42.1.

2 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:pypi/ouroboros-ai

2 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:pypi/ouroboros-ai. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-jv2h-4p9v-wf5w - HIGH ouroboros-ai: Incomplete fix of CVE-2026-47211: untrusted project .env can still reach RCE via omitted execution-routing keys
GHSA-c4m7-2gwp-vw76 CVE-2026-47211 HIGH ouroboros-ai Vulnerable to Remote Code Execution via Untrusted Project-Directory .env

GHSA-jv2h-4p9v-wf5w at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-jv2h-4p9v-wf5w
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-15: External Control of System or Configuration Setting
Affected Product ouroboros-ai
Package Ecosystem PyPI
Published Date
Last Updated

How to Fix GHSA-jv2h-4p9v-wf5w

To remediate this vulnerability, upgrade all affected ouroboros-ai dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

ouroboros-ai fixed: 0.42.1
pip install ouroboros-ai>=0.42.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show ouroboros-ai

How to Check if You Are Affected

To determine whether your Python environment is affected by GHSA-jv2h-4p9v-wf5w, inspect your installed packages using pip:

pip show ouroboros-ai

Analyze the terminal output to locate any version of ouroboros-ai in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.42.1), your application is affected.

Note: The pip show ouroboros-ai command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-15: External Control of System or Configuration Setting, where one or more system settings or configuration elements can be externally controlled by a user. In ouroboros-ai, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact The CVE-2026-47211 fix (0.39.0) added `_UNTRUSTED_ENV_DENYLIST` to stop an untrusted project-directory `.env` from redirecting execution. The denylist was incomplete — several execution-routing keys of the same RCE class were omitted, so a malicious cloned repo can still reach arbitrary command execution by shipping a `.env` (auto-loaded at import, no review step): - **Backend config-home roots** `CODEX_HOME`, `OPENCODE_CONFIG`, `OPENCODE_CONFIG_DIR`, `XDG_CONFIG_HOME`: a spawned vendor CLI resolves its config from these. `CODEX_HOME=./.evil` + committed `./.evil/config.toml` redirects the nested Codex agent to attacker config — `mcp_servers.<name>.command/args` (RCE) and `approval_policy="never"` / `sandbox_mode="danger-full-access"` (silent removal of the human approval gate). (reported by matte1782) - **MCP bridge / plugin execution roster** `OUROBOROS_MCP_CONFIG` (the YAML's server `command`/`args` are spawned via stdio_client — RCE), `OUROBOROS_PLUGIN_LOCKFILE`, `OUROBOROS_PLUGIN_TRUST_ROOT` (redirect the installed-plugin roster / trust root so `ooo <name>` dispatches into attacker code). (reported by hackkim) - **SSRF guard toggle** `OUROBOROS_ALLOW_LOCAL_TRANSPORT` (re-enables loopback/private MCP transport targets). - **Instruction / capability roots** `OUROBOROS_AGENTS_DIR`, `COPILOT_CUSTOM_INSTRUCTIONS_DIRS` (replace spawned sub-agent role prompts), `OUROBOROS_RUNTIME_PROFILE` (backend selector), `OUROBOROS_TOOL_CAPABILITIES` (override YAML can lower a tool's `approval_class`, weakening the approval gate). Additionally, the MCP bridge auto-loaded `./.ouroboros/mcp_servers.yaml` from the working directory (`create_bridge_from_env(cwd=Path.cwd())`), so running `ooo` inside a malicious repo spawned the committed roster's `command` — RCE with no `.env` at all. (cwd-branch noted by hackkim) ### Patches Fixed in 0.42.1. All listed keys were added to `_UNTRUSTED_ENV_DENYLIST`; the cwd auto-discovery branch was removed (only the explicit `OUROBOROS_MCP_CONFIG` env var and `~/.ouroboros/mcp_servers.yaml` remain, both trusted). The regression suite now derives from the source denylist to prevent future drift. ### Workarounds Do not run Ouroboros from an untrusted/cloned repository directory; remove any project-directory `.env` and `./.ouroboros/mcp_servers.yaml` before running. ### Credit Reported privately via coordinated disclosure by matte1782 and hackkim (https://github.com/hackkim).

GHSA-jv2h-4p9v-wf5w Affected ouroboros-ai Versions

1 component(s)
Fixed Versions:
0.42.1
Product / Package Ecosystem Affected Versions Fixed Version
ouroboros-ai
PyPI
< 0.42.1
0.42.1

References

Frequently Asked Questions

What is GHSA-jv2h-4p9v-wf5w?
GHSA-jv2h-4p9v-wf5w is a security vulnerability in ouroboros-ai involving Incomplete fix of CVE-2026-47211: untrusted project .env can still reach RCE via omitted execution-routing keys under CWE-15: External Control of System or Configuration Setting.
Which ouroboros-ai versions are affected?
Affected versions include releases prior to 0.42.1 across affected packages: ouroboros-ai.
What version fixes GHSA-jv2h-4p9v-wf5w?
Upgrading to 0.42.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is ouroboros-ai affected?
Yes, ouroboros-ai is affected in releases prior to 0.42.1. Upgrade your dependency to 0.42.1 or later.
What CWE is associated with GHSA-jv2h-4p9v-wf5w?
GHSA-jv2h-4p9v-wf5w is classified under CWE-15: External Control of System or Configuration Setting (One or more system settings or configuration elements can be externally controlled by a user.).
How can I check PyPI dependencies for GHSA-jv2h-4p9v-wf5w?
Run the dependency tree command: 'pip show ouroboros-ai'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-jv2h-4p9v-wf5w",
  "modified" : "2026-06-19T15:12:25Z",
  "published" : "2026-06-19T15:12:25Z",
  "aliases" : [ ],
  "summary" : "ouroboros-ai: Incomplete fix of CVE-2026-47211: untrusted project .env can still reach RCE via omitted execution-routing keys",
  "details" : "### Impact\nThe CVE-2026-47211 fix (0.39.0) added `_UNTRUSTED_ENV_DENYLIST` to stop an untrusted project-directory `.env` from redirecting execution. The denylist was incomplete — several execution-routing keys of the same RCE class were omitted, so a malicious cloned repo can still reach arbitrary command execution by shipping a `.env` (auto-loaded at import, no review step):\n\n- **Backend config-home roots** `CODEX_HOME`, `OPENCODE_CONFIG`, `OPENCODE_CONFIG_DIR`, `XDG_CONFIG_HOME`: a spawned vendor CLI resolves its config from these. `CODEX_HOME=./.evil` + committed `./.evil/config.toml` redirects the nested Codex agent to attacker config — `mcp_servers.<name>.command/args` (RCE) and `approval_policy=\"never\"` / `sandbox_mode=\"danger-full-access\"` (silent removal of the human approval gate). (reported by matte1782)\n- **MCP bridge / plugin execution roster** `OUROBOROS_MCP_CONFIG` (the YAML's server `command`/`args` are spawned via stdio_client — RCE), `OUROBOROS_PLUGIN_LOCKFILE`, `OUROBOROS_PLUGIN_TRUST_ROOT` (redirect the installed-plugin roster / trust root so `ooo <name>` dispatches into attacker code). (reported by hackkim)\n- **SSRF guard toggle** `OUROBOROS_ALLOW_LOCAL_TRANSPORT` (re-enables loopback/private MCP transport targets).\n- **Instruction / capability roots** `OUROBOROS_AGENTS_DIR`, `COPILOT_CUSTOM_INSTRUCTIONS_DIRS` (replace spawned sub-agent role prompts), `OUROBOROS_RUNTIME_PROFILE` (backend selector), `OUROBOROS_TOOL_CAPABILITIES` (override YAML can lower a tool's `approval_class`, weakening the approval gate).\n\nAdditionally, the MCP bridge auto-loaded `./.ouroboros/mcp_servers.yaml` from the working directory (`create_bridge_from_env(cwd=Path.cwd())`), so running `ooo` inside a malicious repo spawned the committed roster's `command` — RCE with no `.env` at all. (cwd-branch noted by hackkim)\n\n### Patches\nFixed in 0.42.1. All listed keys were added to `_UNTRUSTED_ENV_DENYLIST`; the cwd auto-discovery branch was removed (only the explicit `OUROBOROS_MCP_CONFIG` env var and `~/.ouroboros/mcp_servers.yaml` remain, both trusted). The regression suite now derives from the source denylist to prevent future drift.\n\n### Workarounds\nDo not run Ouroboros from an untrusted/cloned repository directory; remove any project-directory `.env` and `./.ouroboros/mcp_servers.yaml` before running.\n\n### Credit\nReported privately via coordinated disclosure by matte1782 and hackkim (https://github.com/hackkim).",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "ouroboros-ai"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.42.1"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.42.0"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/Q00/ouroboros/security/advisories/GHSA-jv2h-4p9v-wf5w"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/Q00/ouroboros"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-15", "CWE-94" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-06-19T15:12:25Z",
    "nvd_published_at" : null
  }
}