Skip to content
Heist/ feed
Back to feed
High

Ouroboros: Remote Code Execution via Untrusted Project-Directory .env

Type: advisorySources: OSV

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.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2026-47211
Confirmed fixed CVEs
Not specified
Updated in this feed
2 Nov 2026, 20:24 UTC · Revision 1

Source evidence

Ouroboros: Remote Code Execution via Untrusted Project-Directory .env

core-osv · Original source

Published 3 Aug 2026, 20:01 UTC

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.

osv:CVE-2026-47211
Complete source record
{
  "id": "3d6905d665f52a18582fa8dcadc58ba08be6a94c9299527bcb6190950b445c8a",
  "url": "https://osv.dev/vulnerability/CVE-2026-47211",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "Ouroboros: Remote Code Execution via Untrusted Project-Directory .env",
    "summary": "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.",
    "evidence": "osv:CVE-2026-47211",
    "products": [],
    "severity": "high",
    "structured": {
      "id": "CVE-2026-47211",
      "aliases": [
        "CVE-2026-47211",
        "GHSA-c4m7-2gwp-vw76",
        "PYSEC-2026-2857"
      ],
      "metrics": [
        {
          "type": "CVSS_V4",
          "score": "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"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/q00/ouroboros",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "2014af0cbce27d88c290347513dee770c8bf2f44"
                },
                {
                  "fixed": "4e70b760b4eb157469b58645339ba831f6513d37"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "fixed": "0.39.0"
                      }
                    ],
                    "source": "AFFECTED_FIELD",
                    "strategy": "StringRangeExpression"
                  },
                  {
                    "range": [
                      {
                        "fixed": "4e70b760b4eb157469b58645339ba831f6513d37"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  }
                ]
              }
            }
          ],
          "versions": [
            "v0.38.2",
            "v0.38.1",
            "v0.38.0",
            "v0.37.0",
            "v0.36.0",
            "v0.35.0",
            "v0.34.0",
            "v0.33.0",
            "v0.32.0",
            "v0.31.1",
            "v0.31.0",
            "v0.30.0",
            "v0.29.2",
            "v0.29.1",
            "v0.29.0",
            "v0.28.8",
            "v0.28.7",
            "v0.28.6",
            "v0.28.5",
            "v0.28.4",
            "v0.28.3",
            "v0.28.2",
            "v0.28.1",
            "v0.28.0",
            "v0.27.2",
            "v0.27.1",
            "v0.26.6",
            "v0.27.0",
            "v0.26.5",
            "v0.26.4",
            "v0.26.3",
            "v0.26.2",
            "v0.26.1",
            "v0.26.0",
            "v0.25.2",
            "v0.25.1",
            "v0.25.0",
            "v0.24.0",
            "v0.23.2",
            "v0.23.1",
            "v0.23.0",
            "v0.22.0",
            "v0.21.1",
            "v0.21.0",
            "v0.20.0",
            "v0.19.1",
            "v0.19.0",
            "v0.18.1",
            "v0.18.0",
            "v0.17.0",
            "v0.16.0",
            "v0.15.0",
            "v0.14.1",
            "v0.14.0",
            "v0.13.7",
            "v0.13.6",
            "v0.13.5",
            "v0.13.4",
            "v0.13.3",
            "v0.13.0",
            "v0.12.2",
            "v0.12.1",
            "v0.12.0",
            "v0.9.0",
            "v0.8.0",
            "v0.7.0",
            "v0.6.0",
            "v0.5.1",
            "v0.5.0",
            "v0.4.1",
            "v0.4.0",
            "v0.3.0",
            "v0.2.3",
            "v0.2.2",
            "v0.2.1",
            "v0.2.0",
            "v0.1.1",
            "v0.1.0a1"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-47211.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:23.380418092Z",
      "provider": "osv",
      "references": [
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/47xxx/CVE-2026-47211.json",
        "https://github.com/Q00/ouroboros/security/advisories/GHSA-c4m7-2gwp-vw76",
        "https://nvd.nist.gov/vuln/detail/CVE-2026-47211",
        "https://github.com/Q00/ouroboros/commit/4e70b760b4eb157469b58645339ba831f6513d37",
        "https://github.com/Q00/ouroboros/pull/1078"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-426"
        ],
        "cna_assigner": "GitHub_M",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/47xxx/CVE-2026-47211.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2026-47211",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 489814,
  "published_at": "2026-08-03T20:01:03.079+00:00"
}