T09 · Insecure Skill Coding Practices
- Location
lib/done_checker.py:183- Finding
Repository-Controlled Arbitrary Shell Command Execution
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill is a real Codex automation system, but it grants persistent, remote, and command-execution authority with several under-scoped safety controls.
Install only if you are comfortable running a persistent local automation service that can control Codex sessions, approve prompts, execute task-defined checks, and send project metadata to messaging services. Before use, remove hard-coded Discord fallbacks, require explicit Telegram chat authorization, lock down config-file permissions, and avoid accepting task YAML from untrusted repositories.
lib/done_checker.py:183Repository-Controlled Arbitrary Shell Command Execution
lib/telegram_bot.py:59Telegram Command Authorization Fails Open When Chat ID Is Missing
scripts/discord-notify.sh:16Hard-Coded Discord Destinations Can Receive Development Metadata
install.sh:102Telegram Bot Token Is Stored Without Enforced Restrictive Permissions
requirements.txt:1Unbounded PyYAML Dependency Produces Non-Reproducible Installations
The supplied code chunk does not implement or support the declared automation system. It only parses a markdown task plan file and reports completion status. Its primary purpose is task-plan completion validation, which is materially different from managing tmux-based Codex CLI sessions or any watchdog/orchestration behavior described. No evidence appears of tmux interaction, launchd integration, session management, queue dispatch, review automation, or related triggers.
The declared description describes a complex automation/orchestration system for Codex CLI sessions using tmux and launchd. The supplied code does none of that. It only creates three markdown planning/progress files in the current directory and prints next-step instructions. There is no tmux interaction, no background loop, no launchd integration, no session management, no queue processing, and no code review or compaction logic. This is a clear description-behavior mismatch with a materially different primary purpose.
The declared description describes a broad automation/orchestration system for multiple Codex CLI sessions using tmux and launchd. The supplied code does not implement any of those core behaviors. Instead, it is a session catch-up utility that reads local AI assistant session logs from ~/.claude or ~/.gemini, identifies where planning files were last edited, extracts later conversation context, and prints a recovery summary. While both involve AI coding sessions and context, the code’s primary purpose is retrospective context reconstruction for one project, not active multi-session automation or watchdog control. This is a material description-behavior mismatch.
The declared description specifies a substantial automation/orchestration system with many concrete capabilities. However, the supplied code chunk is only a placeholder init.py file containing a comment and no functional code. Therefore, the actual behavior does not substantiate the declared purpose, making this a clear description-behavior mismatch.
The declared description presents a broad orchestration system for managing multiple Codex CLI sessions in tmux with launchd/watchdog behavior. The supplied code chunk is instead a focused GUI message-sending helper for the Codex desktop app on macOS. Its primary function is clipboard-based UI automation through AppleScript/System Events and CGEvent keyboard injection, which is materially different from tmux session monitoring and multi-project automation. The code also accesses resources not implied by the description, such as the system clipboard and macOS accessibility/UI automation interfaces. This is a clear description-to-behavior mismatch.
The supplied code chunk is narrowly focused on validating 'done' conditions for a task: checking whether files exist and meet size/content constraints, whether glob patterns match enough files, and whether specified shell commands return expected exit codes. This is materially different from the declared system description of a tmux/launchd-based multi-session Codex automation orchestrator. The code does not interact with tmux, launchd, Codex sessions, queues, watchdog loops, or review/context-management mechanisms. Additionally, it includes command execution capability via subprocess, which is not reflected in the declared description for this component. Therefore, the description does not accurately represent the behavior of this code chunk.
The supplied code chunk is a narrow text-classification component, not an automation system. It does not interact with tmux, launchd, processes, multiple projects, queues, permissions, or session management. While it does include detection of review-like output and could plausibly support a watchdog/orchestration system as an internal helper, the declared description presents a much broader operational automation capability than this code actually implements. Therefore the description does not accurately represent this code chunk's actual behavior.
The supplied code does not implement any tmux, launchd, Codex CLI, watchdog, session orchestration, queue management, review automation, or permission-management behavior described in the declared purpose. Instead, it performs filesystem scanning and milestone progress reporting for software projects. This is a materially different primary purpose, not merely a supporting component of the declared automation system, based on the code chunk alone.
The supplied code chunk is narrowly focused on generating reply text templates and orchestration-related messages for a Codex-like workflow. It contains functions for intent-based replies, nudges, failed-done-condition messages, next-task prompts, all-tasks-complete notices, and human review notices. While some small overlap exists with the declared system concept—such as generating nudges and task/review-related messages—this module does not implement the primary declared behavior of a tmux + launchd watchdog automation system. There is no code for tmux control, launchd integration, monitoring loops, session management across projects, permission handling, context compaction, or queue dispatch. Therefore the description materially overstates and misrepresents what this specific code chunk actually does.
The supplied code is a task dependency and state orchestration module, not a tmux/launchd-based Codex CLI automation system. Its actual functionality is limited to parsing tasks.yaml, tracking per-task status, checking dependencies, generating contextual prompts, dispatching ready tasks, handling manual approval gates, and reporting progress. While 'dispatches tasks from a queue' is partially consistent with the description, the major declared capabilities—session monitoring, tmux integration, launchd watchdog behavior, nudging idle sessions, permission management, context compaction, and code review loops—are absent from this code chunk. Therefore the description materially overstates and misrepresents what this code actually does.
The supplied code does not implement the declared primary functionality of tmux/launchd-based Codex session watchdog automation. Instead, it provides a Telegram integration layer for receiving and handling remote bot commands over the Telegram API. While some commands operate on project/session/task state consistent with a broader multi-project automation system, the code chunk’s actual behavior is specifically a networked Telegram bot control surface, which is not disclosed in the description. This is a materially different and undeclared capability, especially because it introduces external network access and remote control triggers unrelated to the declared tmux/watchdog automation description.
The supplied code does not implement the declared core behavior of tmux/launchd-based Codex session orchestration, watchdog monitoring, idle nudging, permission handling, context compaction, code review, or task queue dispatch. Instead, it is a standalone notification module that sends messages to Telegram over HTTP using bot credentials and chat IDs. While the notification templates reference 'Autopilot' and project status, that only suggests it may support a larger automation system; this code chunk itself primarily provides Telegram messaging functionality, which is an undeclared capability and materially different primary purpose from the description.
The declared description presents a multi-project tmux/launchd watchdog system centered on monitoring Codex CLI sessions, nudging idle sessions, handling permissions, compacting context, running reviews, and dispatching queued tasks. This code chunk does not implement session monitoring or tmux orchestration. Instead, it is a specialized fallback runner that substitutes another agent when Codex limits are exhausted, constructs a prompt from project files, runs openclaw agent to perform the task, inspects git history for new commits, sends Telegram notifications, and updates queue/state files. While task-queue interaction and automation themes are adjacent to the broader system, this specific code’s primary purpose and capabilities are materially different from the declared behavior.
The supplied code chunk implements a narrow maintenance task: synchronizing state.json with configured projects by deleting stale project data. It only performs local file I/O on config and state files and path/name validation. This is materially different from the declared purpose of a multi-project tmux/launchd Codex automation system with watchdog behavior and orchestration features. While state cleanup could be a supporting utility within such a system, this specific chunk does not actually exhibit the declared core behaviors, so the description does not accurately represent what this code chunk does.
The code’s actual purpose is materially different from the declared description. It does not automate or orchestrate Codex CLI sessions; instead, it reads historical session log files, parses token_count events, aggregates token usage by project, and emits a machine-readable JSON report. While both relate to Codex and projects, the declared system is an active multi-session tmux/launchd automation/watchdog framework, whereas this script is a passive analytics/reporting tool. The filesystem access to ~/.codex/sessions is consistent with Codex usage, but the primary behavior and capabilities are substantially mismatched.
The supplied code chunk does not implement the declared tmux/watchdog/Codex session automation behavior. Its primary purpose is Discord notification delivery. While window-name mapping could be tangentially related to tmux workflows, the core behavior is sending outbound Discord messages using a bot token and the Discord API, which is a distinct capability not described in the declared purpose. Therefore this is a clear description-behavior mismatch.
The supplied code chunk does not implement or expose behavior aligned with the declared automation system. Instead, it is a simple wrapper script for a Python-based PRD verification engine. There is no evidence of tmux interaction, launchd integration, watchdog looping, Codex session management, queue handling, or review/context automation. This is a materially different primary purpose, so the description does not accurately represent the code.
The declared description describes an orchestration/automation system for supervising multiple Codex CLI sessions via tmux and launchd. The supplied code does none of that. Its primary purpose is validating PRD items from a YAML file against checks, generating a JSON report, optionally running shell commands as verification steps, and syncing a markdown todo file. This is a materially different function, with different resources and outputs. The mismatch is clear and substantial, not just a missing feature or implementation detail.
The declared description describes an automation/orchestration system centered on tmux, launchd, Codex session management, watchdog behavior, and task dispatch. The supplied code does none of that. It is a focused file-processing utility: it reads a markdown review file, extracts P0/P1 table rows, maps priorities to severities, updates a PRD items YAML document with bugfix entries, and prints a JSON summary. This is a materially different primary purpose and capability set from the declared description, so it should be flagged as a mismatch.
The declared description describes a substantial automation/orchestration system with multiple concrete capabilities. The supplied code chunk is only a minimal tests/init.py file containing a comment and no executable logic. Because the actual code does not implement or evidence the declared functionality, the description does not accurately represent this code chunk. The mention of 'Codex Desktop Autopilot' also suggests a different component name/context than the declared tmux + launchd multi-project Codex CLI automation system.
The supplied code does not implement or exercise a tmux/launchd-based Codex automation system. Instead, it is a test suite for completion-condition checking utilities. Its observable behavior is limited to unit-testing file checks, glob checks, shell command checks, aggregation of 'done' conditions, and formatting of results. While command execution is present in tests, it is only for validating a checker utility, not for orchestrating Codex sessions or automation workflows. Therefore the actual code's primary purpose is materially different from the declared description.
The supplied code chunk is only a test suite for a natural-language intent analyzer. It imports analyze_intent and asserts expected classifications for various Chinese and English phrases. There is no evidence of tmux interaction, launchd integration, watchdog loops, Codex CLI session management, queue handling, permission workflows, or project orchestration. The code’s primary purpose is materially different from the declared description, so this is a clear mismatch.
The supplied code does not implement the declared automation system itself. It is a test suite focused narrowly on scheduler behavior and project state management. While some concepts overlap with multi-project orchestration (project loading, scheduling, lifecycle, cooldowns), the actual code chunk neither monitors tmux/Codex sessions in a watchdog loop nor performs launchd integration, nudging, permission handling, context compaction, code reviews, or queue dispatch. The primary purpose of the code chunk is testing scheduler logic, which is materially different from the declared end-user skill description.
The supplied code does not implement the declared automation/orchestration system. It is only a test module validating two narrow behaviors in a session monitor library: time-based session state classification and extraction of the last assistant message from JSONL files. While these tests may support a broader Codex session management system, this specific chunk neither manages tmux/launchd nor automates multiple projects, dispatches tasks, runs reviews, or performs watchdog actions. Therefore the chunk’s actual behavior is materially narrower and different from the declared purpose.
The supplied code does not implement or exercise the declared tmux/launchd Codex automation workflow. Instead, it is narrowly focused on unit tests for a state manager: counters, cooldown timing, daily limits, project state lookup, history logging, and persistence to a state file. While such state tracking could be a supporting component of a larger automation system, this chunk’s actual behavior is materially different from the declared primary purpose and does not show the advertised monitoring/orchestration capabilities.