Skip to content
HighVulnerability

GHSA-c4m7-2gwp-vw76: ouroboros-ai Vulnerable to Remote Code Execution via Untrusted Project-Directory .env

Published
Record updated
View JSON
Affected
  • ouroboros-ai < 0.39.0
Fixed in
0.39.0
Known exploitation
Not listed in the CISA Known Exploited Vulnerabilities catalog at the last check.
EPSS
0.2%

Summary

Ouroboros loaded the `.env` file from the current working directory, so execution-affecting variables such as `OUROBOROS_CLI_PATH` and `OPENCODE_CLI_PATH` could be set by a malicious cloned repository. Running an Ouroboros command such as `ouroboros init` in that directory could execute an attacker's script instead of the intended CLI, leading to arbitrary code execution. The flaw is patched in version 0.39.0 via PR #1078.

Mitigation

Fixed in 0.39.0 (PR #1078): a denylist now blocks execution-affecting environment variables, such as runtime selectors and CLI path overrides, from being loaded from the project directory. Upgrade to version 0.39.0 or later. Workaround if upgrading is not immediately possible: inspect any `.env` file inside cloned repositories before running Ouroboros commands to ensure it does not contain unexpected `OUROBOROS_*_CLI_PATH` or `OPENCODE_CLI_PATH` overrides.