Back to skill

Security audit

Codex Pet — Pro Pack on RunComfy

Security checks for vulnerabilities and agentic risk

Overview

The skill does what it says, but its install and file-writing instructions need review because they use an unpinned global CLI install and an unsanitized pet name in paths.

Install only if you are comfortable using RunComfy and a third-party global npm CLI. Pin or verify the RunComfy CLI where possible, keep RUNCOMFY_TOKEN scoped, use a simple pet name containing only letters, numbers, underscores, or hyphens, and confirm the final destination remains under your Codex pets directory before copying files.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (2)

T08 · Insecure Dependencies

Warning
Location
SKILL.md:99
Finding

Unpinned Global Installation of a Third-Party CLI

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, line 99
Vulnerability Type: Unpinned third-party dependency and supply-chain exposure
Risk Level: Medium

Vulnerable Code:

bash
npm i -g @runcomfy/cli

Technical Analysis

The Skill instructs users to install the latest available version of @runcomfy/cli globally. It does not specify a reviewed version, lock an integrity hash, or provide a provenance-verification procedure.

npm packages can execute lifecycle scripts during installation. Consequently, a compromised or unexpectedly modified package release could execute code with the privileges of the user running npm. The CLI also operates in a context where it can access the RunComfy authentication token, RunComfy configuration, submitted image URLs, and generated files.

This is a supply-chain risk rather than evidence that the current RunComfy package is malicious. The effective installation payload can change after the Skill itself has been audited because the command resolves the package version at execution time.

Attack Path

  1. An attacker compromises the upstream npm package, its publisher account, or a future package release.
  2. The attacker publishes a malicious version under the legitimate package name.
  3. A user follows the Skill instructions and runs npm i -g @runcomfy/cli.
  4. npm retrieves the latest release and may execute attacker-controlled lifecycle scripts during installation.
  5. The installed package can execute with the invoking user's privileges.
  6. When subsequently used, the malicious CLI can access RUNCOMFY_TOKEN, local RunComfy configuration, user-provided image URLs, generated files, and other files available to that user.

Impact Assessment

Successful exploitation could provide arbitrary code execution with the invoking user's privileges. The attacker could steal the RunComfy token, inspect or modify user-accessible files, alter generated artifacts, o ...[truncated 284 chars]

Remediation
View remediation

Remediation Suggestions

  1. Pin the CLI to an explicitly reviewed version, for example:
    bash
    npm install --global @runcomfy/cli@<reviewed-version>
    
  2. Publish and verify the expected package integrity digest or npm provenance before installation.
  3. Prefer a project-local installation with a committed lockfile over a global installation.
  4. Disable npm lifecycle scripts during installation where compatible:
    bash
    npm install --ignore-scripts --save-exact @runcomfy/cli@<reviewed-version>
    
  5. Document the expected package publisher, registry, version, and checksum so users can identify dependency confusion or package substitution.
  6. Run the CLI under a minimally privileged account and expose RUNCOMFY_TOKEN only for the duration of the required API call.
  7. Periodically review and deliberately update the pinned version rather than implicitly accepting every upstream release.

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:118
Finding

Path Traversal Through an Unvalidated Pet Name

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 118-122 and 248-251
Vulnerability Type: User-controlled path construction without validation
Risk Level: Medium

Vulnerable Code:

bash
PET_NAME="my-pet"
PET_DESC="A friendly companion for late-night refactors."
SOURCE_URL="https://.../source.png"
RUN_DIR="./codex-pet-run/${PET_NAME}"
CHROMA="#FF00FF"   # magenta chroma-key
mkdir -p "${RUN_DIR}"
bash
DEST="${CODEX_HOME:-$HOME/.codex}/pets/${PET_NAME}"
mkdir -p "${DEST}"
cp "${RUN_DIR}/pet.json" "${RUN_DIR}/spritesheet.webp" "${DEST}/"
echo "Codex Pet installed at ${DEST}"

Technical Analysis

PET_NAME is interpolated directly into both the working directory and final installation directory. Shell quoting prevents word splitting and command substitution at the point of use, but it does not prevent filesystem traversal.

If an agent derives PET_NAME from an untrusted request, a value containing path separators and traversal components such as ../../ can cause the normalized path to escape ./codex-pet-run/ or ${CODEX_HOME:-$HOME/.codex}/pets/. The subsequent mkdir, file-generation operations, and cp command then act on the resolved unintended location.

Because cp overwrites same-named destination files by default, an attacker may be able to replace existing pet.json or spritesheet.webp files in another user-writable directory. No canonical-path containment check or allowlist validation is documented.

Attack Path

  1. An attacker supplies or influences a requested pet name containing traversal components, such as ../../target-directory.
  2. The agent assigns that value to PET_NAME without validation.
  3. RUN_DIR="./codex-pet-run/${PET_NAME}" resolves outside the intended working directory.
  4. DEST="${CODEX_HOME:-$HOME/.codex}/pets/${PET_NAME}" similarly resolves outside the intended pets directory.
  5. mkdir -p creates the attacker-select ...[truncated 733 chars]
Remediation
View remediation

Remediation Suggestions

  1. Validate PET_NAME against a strict allowlist before using it in any path:
    bash
    case "$PET_NAME" in
      ""|*[!A-Za-z0-9_-]*)
        echo "Invalid pet name" >&2
        exit 64
        ;;
    esac
    
  2. Impose a reasonable maximum length, such as 64 characters.
  3. Explicitly reject /, \, .., control characters, and names beginning with a dot.
  4. Resolve the intended base and destination to canonical paths and verify that the destination remains beneath the expected base directory.
  5. Separate the user-facing display name from the filesystem identifier. Generate a sanitized slug or random internal identifier for paths.
  6. Avoid silently overwriting existing installations. Check whether the destination exists and require explicit confirmation or use no-clobber behavior.
  7. Apply the same validation before writing pet.json so the manifest identifier and installation directory remain consistent.
Vulnerability Patterns
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (3)

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill advertises very broad natural-language triggers, including generic phrases and 'any explicit ask' patterns, which can cause the agent to invoke this skill in contexts the user did not clearly intend. Over-broad activation increases the chance of unnecessary external API usage and unintended file writes into the local Codex pets directory.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · SKILL.md (reported line 17)May include surrounding context.

md
Pet pose, then assembles all 9 animation rows programmatically with
  ImageMagick micro-transforms — no Codex Pro, no `$imagegen`, no
  OPENAI_API_KEY required, only RUNCOMFY_TOKEN. Triggers on "codex pet",
  "create codex pet", "make codex pet", "hatch codex pet", "/hatch
  image", "desktop pet codex", "codex pets", "spritesheet.webp", or any
  explicit ask to build a custom pet for OpenAI Codex.
emoji: "🫧"

Vague Triggers

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

The usage guidance repeats broad trigger examples without clearly scoping when the skill should not run, reinforcing accidental activation behavior. While not directly enabling code execution, it can lead to unintended network requests and local artifact installation when the user's request is ambiguous.

Content

No source excerpt is available for this finding.