Fix vulnerabilities to prevent commands from being executed without authorization.
- Command Injection via args in /run
File: app.py:57, 162
args: List[str] = Field(default_factory=list, description='Extra CLI args')
cmd = [CODEX_BIN, "exec", "-m", model, *args, "--skip-git-repo-check"]
User-defined arguments are directly substituted into the command line. An attacker can pass "args": ["--some-flag", "; rm -rf /"] or other dangerous arguments.
- Endpoint /run without authentication
File: app.py:216-228
@app.post("/run", response_model=RunResponse)
async def run(req: RunRequest): # ← no Depends(_require_token)
Anyone who can reach port 8000 can execute Codex CLI commands without a token. Combined with vulnerability #1, this is a complete RCE.
Fix vulnerabilities to prevent commands from being executed without authorization.
File: app.py:57, 162
args: List[str] = Field(default_factory=list, description='Extra CLI args')
cmd = [CODEX_BIN, "exec", "-m", model, *args, "--skip-git-repo-check"]
User-defined arguments are directly substituted into the command line. An attacker can pass "args": ["--some-flag", "; rm -rf /"] or other dangerous arguments.
File: app.py:216-228
@app.post("/run", response_model=RunResponse)
async def run(req: RunRequest): # ← no Depends(_require_token)
Anyone who can reach port 8000 can execute Codex CLI commands without a token. Combined with vulnerability #1, this is a complete RCE.