Back to skill

Security audit

Codex Token Usage

Security checks for vulnerabilities and agentic risk

Overview

This skill coherently summarizes local Codex token-usage logs and does not show hidden, destructive, persistent, or exfiltrating behavior.

Before installing, understand that this skill reads local Codex session log files to calculate aggregate token usage. It appears suitable for that purpose, but avoid sharing its output if session counts, dates, or usage volumes are sensitive to you or your organization.

Vulnerability Patterns
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Vulnerability Patterns
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • 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 (2)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill instructs the agent to execute a local Python script, read Codex session logs from disk, inspect environment-dependent context such as timezone, and potentially write or emit structured output, but it declares no explicit tool scope or permissions. This creates an authorization gap: an agent may use shell and filesystem capabilities broader than necessary, increasing the chance of unintended access to sensitive local files or misuse of command execution in environments that rely on skill metadata for policy enforcement.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/test_codex_token_usage.py (reported line 55)May include surrounding context.

python
"en",
        *args,
    ]
    return subprocess.run(command, text=True, capture_output=True, check=True)


def test_json_output():

Static analysis

No suspicious patterns detected.