Back to skill

Security audit

Codex Conductor

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent software-delivery orchestrator, but it delegates broad code-changing and command-running authority to external agents with limited containment.

Install only if you are comfortable letting this skill orchestrate other coding agents and run project validation commands. Prefer gated mode, avoid --full-auto for unreviewed tasks, run it in a disposable branch/worktree, keep validation commands explicit and reviewed, and use staging or sandbox accounts for delete, payment, migration, and rollback tests. Do not use the packaging helper on directories containing secrets, symlinks, .env files, or generated archives.

Vulnerability Patterns
  • 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
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/package_skill.py:28
Finding
Unrestricted Archive Collection Can Disclose Local Files## Vulnerability Details **File Location**: `scripts/package_skill.py`, lines 28-31 **Vulnerability Type**: Unsafe archive creation and unintended file disclosure **Risk Level**: Medium ### Vulnerable Code ```python with zipfile.ZipFile(out_file, "w", zipfile.ZIP_DEFLATED) as zf: for path in skill_dir.rglob("*"): if path.is_file(): arcname = f"{skill_name}/{path.relative_to(skill_dir)}" zf.write(path, arcname) ``` ### Technical Analysis The packaging function recursively archives every file found below the supplied Skill directory. It does not: - Restrict packaging to an explicit allowlist. - Exclude secret-bearing files such as `.env` or private configuration files. - Exclude VCS metadata, temporary files, build artifacts, or the output directory. - Reject symbolic links before calling `is_file()` and `zf.write()`. - Resolve each candidate and verify that its target remains within the Skill directory. `Path.is_file()` follows symbolic links. Consequently, a symbolic link located inside the Skill directory can point to an arbitrary readable file elsewhere on the host, and `ZipFile.write()` can copy the target's contents into the generated archive. The archive entry retains the in-tree symbolic-link path, making the external origin of the packaged content non-obvious. If `--out` points to a directory inside `skill_dir`, the archive currently being generated may also be encountered by the recursive traversal. This can produce malformed, unexpectedly large, or non-deterministic artifacts. ### Attack Path 1. An attacker gains the ability to contribute files to the Skill directory, such as through a malicious pull request or compromised source archive. 2. The attacker adds a symbolic link beneath that directory pointing to a predictable sensitive file readable by the packaging user, or adds secret-bearing files that should not be distributed. 3. A maintainer runs `scripts/package_skill.py` without reviewing every recurs ...[truncated 1011 chars]
Remediation
## Remediation Suggestions 1. **Use an explicit packaging allowlist.** Package only known distributable files and directories, such as `SKILL.md`, approved files under `references/`, and approved scripts under `scripts/`. 2. **Reject symbolic links explicitly.** ```python if path.is_symlink(): raise ValueError(f"Symbolic links are not allowed: {path}") ``` 3. **Enforce containment after resolution.** Resolve every candidate and verify that it remains beneath the resolved Skill root before reading it. ```python skill_root = skill_dir.resolve() resolved = path.resolve(strict=True) if not resolved.is_relative_to(skill_root): raise ValueError(f"Path escapes skill directory: {path}") ``` 4. **Exclude sensitive and generated content.** At minimum, reject `.env*`, credential and key files, `.git`, caches, temporary files, build outputs, and distribution directories. 5. **Require the output directory to be outside the Skill directory.** Resolve both paths and abort if the output directory equals or is nested beneath `skill_dir`. 6. **Precompute the file manifest before opening the output archive.** Validate the complete manifest first, then create the archive. This prevents the newly created archive from entering an active recursive traversal. 7. **Log and review the manifest.** Print every included relative path and optionally require confirmation before creating a release artifact. 8. **Add regression tests** covering external symbolic links, internal symbolic links, `.env` exclusion, nested output directories, and valid allowlisted packaging.
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (21)

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding
The declared description presents a comprehensive software delivery orchestration system with lifecycle management features and structured project/execution modes. The supplied code chunk instead performs a much narrower function: it validates arguments, reads a prompt file, optionally enforces presence of a spec reference, and launches an external agent CLI with the prompt text. While the simple spec-ref check is loosely related to a gated workflow, the code does not implement the broad orchestration, tracking, testing, documentation, or change-management capabilities claimed. It also dispatches to multiple agents, not just Codex CLI. This is a material description-to-behavior mismatch.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
The declared description presents a comprehensive delivery orchestrator managing the full software lifecycle with multiple project and execution modes, stage gates, testing workflows, progress tracking, and reusable agent workflow support. The supplied code does not implement such orchestration. It is a focused script that accepts a change request string and appends templated entries to docs/change-log.md, docs/tasks.md, docs/traceability.md, and docs/change-impact.md. While this partially aligns with the declared mention of change-impact management and continuous docs updates, those are only a small subset of the claimed functionality. The primary purpose and capabilities are materially narrower than described, so this is a clear description-behavior mismatch.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding
The declared description presents a full lifecycle orchestration skill with operational delivery control, dual project and execution modes, gate management, testing flow, and ongoing documentation/change management. The supplied code chunk is much narrower: it only bootstraps a set of markdown and JSON template files, initializes basic status/context metadata, and logs one initialization event. While the scaffold aligns with the orchestrator theme and includes artifacts for gates, tests, release, change log, and AGENTS.md, the actual behavior does not implement the core orchestrator capabilities claimed in the description. The most concrete mismatch is that the code supports greenfield/brownfield selection but not real dual execution modes, since it hardcodes 'gated' in context.json and exposes no autonomous mode. Overall, this is a materially narrower initialization utility rather than the described end-to-end orchestrator.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
The supplied code does not implement the declared orchestration behavior. Its actual purpose is limited to validating that certain files exist and packaging the directory into a zip-based .skill artifact. While it references filenames associated with orchestration components, this code itself does not perform lifecycle delivery, gating, testing, documentation updates, or agent workflow management. Therefore the description materially overstates and misrepresents what this code chunk actually does.

Ae1

High
Category
analysis-evasion
Content
- `run_gate.py` requires `--spec-ref` for G3/G4 tasks (implementation gates).
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
- `run_gate.py` requires `--spec-ref` for G3/G4 tasks (implementation gates).
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
- `run_gate.py` requires `--spec-ref` for G3/G4 tasks (implementation gates).
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
- `run_gate.py` requires `--spec-ref` for G3/G4 tasks (implementation gates).
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
- `run_gate.py` requires `--spec-ref` for G3/G4 tasks (implementation gates).
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

External Model or Provider Selection

High
Category
Excessive Agency
Content
### Codex
```bash
codex exec --full-auto "<gate task prompt>"
```

### Claude
Confidence
95% confidence
Finding
The runbook explicitly instructs the orchestrator to invoke an externally selected coding agent and, for Codex, to run it in `--full-auto` mode with a generated prompt. This creates a real delegated-execution boundary where untrusted or weakly reviewed prompts can cause autonomous code changes, command execution, and follow-on documentation updates without sufficient human approval at the invocation point.

Prompt Exfiltration via Tool

High
Category
System Prompt Leakage
Content
parser.add_argument("--research-mode", choices=["true", "false"], default="false")
    parser.add_argument("--task", required=True, help="Single task summary")
    parser.add_argument("--spec-ref", default="", help="Spec reference for this task")
    parser.add_argument("--output", help="Write prompt to file")
    args = parser.parse_args()

    body = TEMPLATES[args.gate]
Confidence
85% confidence
Finding
Skill contains patterns that exfiltrate system prompts or internal instructions via tool calls (file writes, network requests, logging).

Direct Prompt Extraction

High
Category
System Prompt Leakage
Content
openclaw gateway wake --text "Done: {gate} fix attempt {retry_num} complete | verify: docs/agent-handoff.md" --mode now
"""
    prompt_path.write_text(prompt, encoding="utf-8")
    return prompt_path


def execute_agent(agent_cmd_base: list[str], prompt_file: str):
Confidence
85% confidence
Finding
Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Lp3

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding
The skill instructs use of file reads/writes and shell execution but does not declare any explicit tool scope or permissions boundary. That makes the skill's operational capabilities ambiguous to users and enforcement layers, increasing the chance of overbroad execution, unsafe command use, or unintended filesystem modification during orchestration.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The manual test templates direct users to perform potentially destructive actions such as deleting entities, exercising payment flows, and rehearsing rollback operations, but they never state that these tests must be run only in isolated test/staging environments with non-production data and safe payment simulators. In an orchestration skill that encourages end-to-end execution and repeated retesting, this omission materially increases the chance that an operator or agent applies the checklist against live systems, causing data loss, unintended charges, or service disruption.

subprocess module call

Medium
Category
Dangerous Code Execution
Content
def run(cmd, cwd=None):
    p = subprocess.run(cmd, cwd=cwd, text=True, capture_output=True)
    if p.stdout:
        print(p.stdout.strip())
    if p.returncode != 0:
Confidence
70% confidence
Finding
subprocess module calls execute external commands. Without careful input validation, this enables command injection.

subprocess module call

Medium
Category
Dangerous Code Execution
Content
def run(cmd, cwd=None):
    p = subprocess.run(cmd, cwd=cwd, text=True, capture_output=True)
    if p.stdout:
        print(p.stdout.strip())
    if p.returncode != 0:
Confidence
70% confidence
Finding
subprocess module calls execute external commands. Without careful input validation, this enables command injection.

subprocess module call

Medium
Category
Dangerous Code Execution
Content
def run(cmd, cwd=None):
    p = subprocess.run(cmd, cwd=cwd, text=True, capture_output=True)
    if p.stdout:
        print(p.stdout.strip())
    if p.returncode != 0:
Confidence
70% confidence
Finding
subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Missing User Warnings

Medium
Confidence
98% confidence
Finding
The script executes each --validate-cmd by invoking bash -lc on the supplied string, which gives full shell execution to user-controlled input. In an orchestrator skill, this is especially dangerous because validation commands may come from prompts, docs, agent outputs, or automation pipelines, turning a convenience feature into arbitrary command execution against the local project or host.

Missing User Warnings

Low
Confidence
82% confidence
Finding
This code creates directories and writes multiple files, including appending to docs/progress.md, but the only visible disclosure is a final success print after the writes complete. There is no prior confirmation prompt, explicit warning comment/docstring, or other user-facing notice near the write operations themselves describing that the script will create and modify files under the target root.

Missing User Warnings

Low
Confidence
78% confidence
Finding
This code creates an output directory and writes a .skill archive to disk, but the only user-facing message is printed after packaging completes. There is no confirmation prompt, pre-action notice, or inline comment/docstring disclosing that filesystem writes will occur.

Missing User Warnings

Low
Confidence
88% confidence
Finding
This Python code performs several filesystem writes to documentation files via append() but only prints a generic success message after the fact. There is no confirmation prompt, pre-write user disclosure, or inline comment/docstring warning that the script will create and modify files under docs/.

Static analysis

No suspicious patterns detected.