Back to skill

Security audit

codexbox

Security checks for vulnerabilities and agentic risk

Overview

The skill is coherent for running Codex in a container, but it documents high-impact service modes that can expose unauthenticated agent execution and workspace file access if tokens are unset.

Install only if you are comfortable running a powerful containerized agent. Pin or inspect the installer and Docker image before use, set distinct API and MCP bearer tokens before enabling those modes, bind services to localhost or a protected proxy, avoid exposing /files or MCP to untrusted networks, and do not mount SSH, Codex auth, Docker, or extra host directories unless the specific task requires them.

Vulnerability Patterns
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T03 · Remote Payload Retrieval and Execution

Error
Location
references/setup.md:18
Finding
Mutable Remote Installer and Container Images Permit Unreviewed Code Execution## Vulnerability Details **File Location**: `references/setup.md`, lines 18-25 **Vulnerability Type**: Remote payload retrieval and insecure dependency pinning **Risk Level**: High ### Vulnerable Code ```bash ## Quick Install (wrapper) The one-liner installer pulls the image, creates persistent Codex/SSH dirs, and installs the `codexbox` wrapper on `PATH`. **Recommended: download, inspect, then run.** Piping a remote script straight into bash executes unreviewed remote code as you. Download it, read it, then run it: ```bash curl -fsSL -o install.sh https://raw.githubusercontent.com/psyb0t/docker-codexbox/master/install.sh less install.sh # read it before running anything bash install.sh # minimal image — default # CODEXBOX_FULL=1 bash install.sh # full image — every development tool pre-installed # bash install.sh codex # custom command name ``` ``` The same documentation identifies mutable container tags at `references/setup.md:71-73`: ```text | Minimal (default) | `psyb0t/codexbox:latest` | Codex, Node.js, Python, `uv`, Docker, Git, `jq`, `curl` | | Full | `psyb0t/codexbox:latest-full` | Everything in minimal + Go, gopls/Delve/golangci-lint/staticcheck/gofumpt, Python lint/type/test tooling, JS/TS lint/format/framework CLIs, GitHub CLI, Terraform, kubectl, Helm, build tools (CMake/ClangFormat/Valgrind/GDB/strace/ltrace), Postgres/MySQL/SQLite/Redis clients, editors/shell tools | ``` ### Technical Analysis The installation process retrieves a shell script from the mutable `master` branch of a personal GitHub repository and subsequently executes it with the invoking user's permissions. The downloaded installer is not included in the audited project, and the documentation provides no immutable commit reference, expected checksum, or signature. Asking the user to inspect the script is safer than directly piping it into a shell, but it is not a reliable integrity con ...[truncated 2371 chars]
Remediation
## Remediation Suggestions 1. Pin the installer URL to a reviewed immutable Git commit instead of `master`. 2. Publish an expected SHA-256 digest and verify it before execution. Prefer a signed release artifact with signature verification. 3. Vendor the installer into the Skill package so that its complete behavior is included in security review. 4. Pin container images by immutable digest, for example `repository@sha256:...`, rather than using `latest` tags. 5. Make SSH-key generation explicitly opt-in and clearly display the affected paths before changing them. 6. Require confirmation before installing wrappers into system-wide command directories. 7. Avoid mounting SSH state, Codex authentication state, or the Docker socket unless the requested operation specifically requires each capability. 8. Document a verified update procedure that requires review and digest changes whenever the installer or image is upgraded.

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:141
Finding
API and MCP Execution Surfaces Fail Open When Authentication Tokens Are Unset## Vulnerability Details **File Location**: `SKILL.md`, lines 141-143 and 210-211 **Vulnerability Type**: Fail-open authentication on remote execution and file-management interfaces **Risk Level**: High ### Vulnerable Code API mode at `SKILL.md:141-143`: ```text With `CODEXBOX_API_MODE_TOKEN` unset the API surface is unauthenticated — anyone who can reach `:8080` gets run-execution plus full workspace file access. Set the token and bind to loopback / behind an authenticating proxy before exposing it beyond localhost. ``` MCP mode at `SKILL.md:210-211`: ```text With `CODEXBOX_MCP_MODE_TOKEN` unset the MCP surface (`run_prompt`, `list_files`, `read_file`, `write_file`, `delete_file`) is unauthenticated — anyone who can reach `/mcp` or the sidecar port gets run-execution plus full workspace file access. This surface has its own bearer; setting `CODEXBOX_API_MODE_TOKEN` does not protect it. Set the token and bind to loopback / behind an authenticating proxy before exposing it beyond localhost. ``` The insecure defaults are also documented in `references/setup.md:130-135` and `references/setup.md:153-158`: ```text | `CODEXBOX_API_MODE_TOKEN` | empty | Bearer token for the API surface (`/run`, `/files/*`, `/openai/v1/*`). Empty = no auth | With `CODEXBOX_API_MODE_TOKEN` unset the API surface (`/run`, `/files/*`, `/openai/v1/*`) is unauthenticated — anyone who can reach it gets run-execution and full workspace file access. ``` ```text | `CODEXBOX_MCP_MODE_TOKEN` | empty | Bearer token for MCP. Empty = no auth. No fallback to `API_MODE_TOKEN` | With `CODEXBOX_MCP_MODE_TOKEN` unset the MCP surface (`run_prompt`, `list_files`, `read_file`, `write_file`, `delete_file`) is unauthenticated — anyone who can reach it gets full workspace file access. ``` ### Technical Analysis Both service modes use an empty authentication token as a supported default. API mode exposes agent execution, OpenAI-compatible completion endpoi ...[truncated 2111 chars]
Remediation
## Remediation Suggestions 1. Refuse to start API or MCP mode unless a non-empty, cryptographically strong token is configured. 2. Bind services to loopback by default and require explicit confirmation for wildcard or public-interface binding. 3. Do not treat an empty token as an authentication-disabled production mode. If an insecure development mode is retained, require a conspicuous flag such as `ALLOW_UNAUTHENTICATED_LOCAL_ONLY=1`. 4. Protect API and MCP consistently, or provide a secure shared-token fallback while preserving the option for separate credentials. 5. Validate token length and randomness and compare credentials using a constant-time operation. 6. Apply least-privilege filesystem access, preferably mounting read-only workspaces unless modification is explicitly required. 7. Separate execution permissions from file read, write, and delete permissions. 8. Add rate limits, request logging, audit trails, and safe request-size and execution-time limits. 9. Refuse public startup when file deletion or execution tools are enabled without an authenticating reverse proxy. 10. Add automated tests confirming that requests without valid credentials receive an authorization error in every API and MCP deployment mode.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • YARA SignaturesMalware Match, Webshell Match, Cryptominer Match
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (15)

YARA rule 'agent_skill_mcp_tool_poisoning_metadata': MCP/tool metadata poisoning indicators in tool schemas or skill manifests [agent_skills]

High
Category
YARA Match
Content
---
name: codexbox
description: "Install, configure, or run Codex through the codexbox wrapper, or connect to its HTTP, MCP, Telegram, or cron surfaces."
homepage: https://github.com/psyb0t/docker-codexbox
user-invocable: true
metadata:
  { "openclaw": { "emoji": "🧑‍💻", "primaryEnv": "CODEXBOX_URL", "requires": { "bins": ["docker", "curl"] } } }
---

# codexbox

[OpenAI Codex CLI](https://github.com/openai/codex) inside an [aicodebox](https://github.com/psyb0t/docker-aicodebox) container, put on the network. codexbox is aicodebox's `codex` adapter — the HTTP/MCP/Telegram/cron surfaces are aicodebox's,
Confidence
80% confidence
Finding
YARA rule matched a hack tool or exploit indicator (offensive tools, reconnaissance, privilege escalation, or exploit frameworks).

Tool Parameter Abuse

High
Category
Tool Misuse
Content
| `GET` | `/openai/v1/models` | model list from `CODEXBOX_AVAILABLE_MODELS` |
| `POST` | `/mcp` | MCP server, mounted only when `CODEXBOX_MCP_MODE=1` (see MCP mode) |

`DELETE /files/{path}` removes a workspace file (no undo). Confirm the target path first and only remove files the current task created — see [Security & safety](#security--safety).

`POST /run` body: `prompt` (required), `workspace`, `model`, `systemPrompt`, `appendSystemPrompt`, `jsonSchema`, `noContinue`, `resume`, `timeoutSeconds`, `thinking`, `noTools`, `toolsAllowlist`, `includeRaw`, `async`, `fireAndForget`. With `jsonSchema` set, the response adds `json`, `events`, `sessionId`, `usage`, `attempts` — codex has native `--output-schema` enforcement, so `jsonSchema` maps straight onto it (no self-correction retries needed, unlike adapters without native schema support).
Confidence
95% confidence
Finding
The skill exposes a file-deletion capability over HTTP (`DELETE /files/{path}`) and separately documents that authentication may be disabled by default on exposed surfaces. If deployed without tokens or with weak operational controls, a reachable caller can delete arbitrary workspace files, causing destructive loss of data and potentially sabotaging builds or agent state.

Rp1

Medium
Category
MCP Rug Pull
Confidence
75% confidence
Finding
Docker image references without a specific tag (:latest is implicit) or digest (@sha256:...) can be silently replaced by a malicious image.

Rp1

Medium
Category
MCP Rug Pull
Confidence
75% confidence
Finding
Docker image references without a specific tag (:latest is implicit) or digest (@sha256:...) can be silently replaced by a malicious image.

External Transmission

Medium
Category
Data Exfiltration
Content
`noContinue` is ephemeral and leaves the workspace pin unchanged.

```bash
curl -s http://localhost:8080/run \
  --oauth2-bearer "$CODEXBOX_API_MODE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"prompt": "say HELLO", "workspace": "/workspace"}'
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
**Fire a one-off prompt from a script:**

```bash
curl -s http://localhost:8080/run \
  -H "Authorization: Bearer $CODEXBOX_TOKEN" -H "Content-Type: application/json" \
  -d '{"prompt": "list every TODO in /workspace", "workspace": "/workspace"}' | jq -r .text
```
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
**Fire a one-off prompt from a script:**

```bash
curl -s http://localhost:8080/run \
  -H "Authorization: Bearer $CODEXBOX_TOKEN" -H "Content-Type: application/json" \
  -d '{"prompt": "list every TODO in /workspace", "workspace": "/workspace"}' | jq -r .text
```
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
**Async run + poll:**

```bash
run_id=$(curl -s http://localhost:8080/run -H "Authorization: Bearer $CODEXBOX_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"prompt": "run the full test suite and summarize failures", "async": true}' | jq -r .runId)
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Rp1

Medium
Category
MCP Rug Pull
Confidence
75% confidence
Finding
Docker image references without a specific tag (:latest is implicit) or digest (@sha256:...) can be silently replaced by a malicious image.

Rp1

Medium
Category
MCP Rug Pull
Confidence
75% confidence
Finding
Docker image references without a specific tag (:latest is implicit) or digest (@sha256:...) can be silently replaced by a malicious image.

Rp1

Medium
Category
MCP Rug Pull
Confidence
75% confidence
Finding
Docker image references without a specific tag (:latest is implicit) or digest (@sha256:...) can be silently replaced by a malicious image.

Rp1

Medium
Category
MCP Rug Pull
Confidence
75% confidence
Finding
Docker image references without a specific tag (:latest is implicit) or digest (@sha256:...) can be silently replaced by a malicious image.

Rp1

Medium
Category
MCP Rug Pull
Confidence
75% confidence
Finding
Docker image references without a specific tag (:latest is implicit) or digest (@sha256:...) can be silently replaced by a malicious image.

Rp1

Medium
Category
MCP Rug Pull
Confidence
75% confidence
Finding
Docker image references without a specific tag (:latest is implicit) or digest (@sha256:...) can be silently replaced by a malicious image.

Rp1

Medium
Category
MCP Rug Pull
Confidence
91% confidence
Finding
This is a valid supply-chain risk because `docker pull psyb0t/codexbox:latest` relies on a mutable `latest` tag rather than an immutable digest. If the upstream image is replaced, compromised, or changed unexpectedly, users may pull and run different code than they reviewed, which is especially relevant here because the skill is explicitly about installing and running a privileged containerized tool with workspace and credential mounts.

Static analysis

No suspicious patterns detected.