Back to skill

Security audit

Clean Codex Archives

Security checks for vulnerabilities and agentic risk

Overview

This skill is a disclosed local cleanup tool for archived Codex history, with deletion gated behind an explicit apply flag.

Install only if you want an agent-assisted way to inspect and delete archived local Codex history. Run the dry run first, review the reported counts, and use --apply only when you are comfortable permanently removing archived sessions and related local database rows.

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
  • Rogue AgentSelf-Modification, Session Persistence
  • 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
89% confidence
Finding

The skill explicitly instructs use of a local cleanup script that reads environment variables, inspects local files, and deletes files and database rows, but it declares no tool scope or permission boundaries in the skill metadata. That omission creates a real least-privilege problem: an agent may be allowed broader file and environment access than users or reviewers can easily infer from the manifest, increasing the chance of unintended destructive operations against local Codex data.

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 · scripts/clean_codex_archives.py (reported line 105)May include surrounding context.

python
line = raw_line.rstrip("\r\n")
            if not line.strip():
                raise RuntimeError(
                    f"Blank line in session index at line {line_number}; refusing to rewrite it"
                )
            try:
                entry = json.loads(line)