Back to skill

Security audit

Codex Usage

Security checks for vulnerabilities and agentic risk

Overview

This skill is a thin wrapper that sends profile-usage requests to an unbundled external profiler and always asks it to process all profiles.

Review before installing. This package is not clearly malicious, but it depends on a separate local codex-profiler implementation and may inspect all Codex profiles even when a user asks for one profile. Only use it if you trust the paired profiler package and are comfortable with all-profile usage/auth-health checks.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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

Error
Location
SKILL.md:8
Finding
Execution Delegated to Unavailable and Unverified External Project Content## Vulnerability Details **File Location**: `SKILL.md`, lines 8-12 **Vulnerability Type**: Unverified external implementation dependency **Risk Level**: High **Complete Code Snippet**: ```markdown > Deprecated wrapper: maintained implementation lives in `skills/codex-profiler/`. For `/codex_usage*` requests, follow `../codex-profiler/SKILL.md` and run: ```bash python3 skills/codex-profiler/scripts/codex_usage.py --profile all --format text ``` ``` ### Technical Analysis The audited skill delegates both instruction processing and local code execution to a separate `codex-profiler` component that is not included in the audited project. Consequently, the security properties of the effective behavior cannot be established from this package. The dependency is neither version-pinned nor protected by an integrity check. If content at the referenced location is mutable or attacker-controlled, it can replace the expected instructions or Python implementation after this wrapper has been reviewed. The documentation reference (`../codex-profiler/SKILL.md`) and executable reference (`skills/codex-profiler/scripts/codex_usage.py`) also use different relative path bases, increasing the possibility of resolving an unintended component. ### Attack Path 1. An attacker gains the ability to create or modify the `codex-profiler` content at either path resolved by the host environment. 2. The attacker replaces `SKILL.md` with hostile agent instructions, replaces `codex_usage.py` with arbitrary Python code, or both. 3. A user submits a supported `/codex_usage*` request. 4. This wrapper instructs the agent to follow the external skill instructions and execute the external Python script. 5. The substituted content executes with the permissions available to the agent or Python process. ### Impact Assessment Successful exploitation could permit arbitrary local code execution within the invoking process's privilege boundary. Depending ...[truncated 434 chars]
Remediation
## Remediation Suggestions - Bundle the required implementation within the audited project so its instructions and executable code can be reviewed together. - If an external component is required, pin it to an immutable, trusted version and verify a cryptographic hash or signature before use. - Resolve the dependency through one canonical absolute path rather than using inconsistent relative paths. - Validate the dependency's ownership and permissions and reject files writable by untrusted users. - Do not automatically load external skill instructions. Define the wrapper's complete behavior locally and invoke only a narrowly scoped, verified executable. - Fail closed when the expected implementation is missing or fails integrity validation.

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
SKILL.md:3
Finding
Profile-Specific Requests Are Expanded to All Available Profiles## Vulnerability Details **File Location**: `SKILL.md`, lines 3 and 10-12 **Vulnerability Type**: Violation of least privilege and request scope **Risk Level**: Medium **Complete Code Snippet**: ```markdown description: Manual Telegram slash-style command for Codex profile status and usage checks. Use when the user sends /codex_usage, /codex_usage default, /codex_usage all, or /codex_usage <profile>, or asks to check openai-codex profile usage/limits/auth health. ``` ```markdown For `/codex_usage*` requests, follow `../codex-profiler/SKILL.md` and run: ```bash python3 skills/codex-profiler/scripts/codex_usage.py --profile all --format text ``` ``` ### Technical Analysis The skill declares support for requests targeting an individual profile, including `/codex_usage <profile>`, but the prescribed command always supplies `--profile all`. It therefore broadens a narrowly scoped request into processing every profile available to the external profiler. This behavior violates least privilege because information and authentication state associated with unrelated profiles may be accessed even when it is unnecessary to satisfy the user's request. The external profiler is unavailable in the audited project, so the exact returned fields and downstream disclosure behavior cannot be confirmed; however, the explicit `--profile all` argument confirms the scope expansion. ### Attack Path 1. Multiple Codex profiles are available to the execution environment. 2. A user requests usage, limits, or authentication health for one named profile. 3. The wrapper ignores that requested scope and invokes the profiler with `--profile all`. 4. The external implementation processes every profile accessible to it. 5. Information for unrelated profiles may be returned, logged, or otherwise processed beyond the user's requested scope, depending on the external implementation. ### Impact Assessment The command may access usage ...[truncated 518 chars]
Remediation
## Remediation Suggestions - Parse and validate the requested profile identifier against an explicit allowlist of profiles the requester is authorized to inspect. - Pass the selected profile to the profiler rather than hard-coding `--profile all`. - Permit `--profile all` only when the user explicitly submits `/codex_usage all` and has authorization to inspect every profile. - Treat `/codex_usage`, `/codex_usage default`, `/codex_usage all`, and `/codex_usage <profile>` as distinct command cases with explicit scope handling. - Enforce authorization in the profiler itself so wrapper mistakes cannot expose unrelated profiles. - Minimize returned fields and avoid displaying or logging credentials, tokens, or other authentication secrets.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep

Static analysis

No suspicious patterns detected.