Skip to content

Fix vulnerabilities #1

Description

@catolseo

Fix vulnerabilities to prevent commands from being executed without authorization.

  1. 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.

  1. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions