T09 · Insecure Skill Coding Practices
- Location
instructions.md:97- Finding
Shell Command Injection in Recommended Stop-Command Integration
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill has a coherent task-interruption purpose, but its documented integration and scripts grant process-control and filesystem mutation authority with unsafe scoping.
Install only after reviewing and hardening the interrupt mechanism. Prefer explicit slash commands, validate session IDs with a strict allowlist, avoid shell exec for script invocation, store flags in a private 0700 directory, use atomic no-follow file creation, JSON-encode values correctly, and require validated session-to-PID ownership before sending SIGINT or deleting any files.
instructions.md:97Shell Command Injection in Recommended Stop-Command Integration
SKILL.md:443Unvalidated Session Identifier Enables Recursive Path Deletion
scripts/create-stop-flag.sh:13Predictable Stop-Flag Path Permits Symlink-Based File Overwrite
scripts/create-stop-flag.sh:13Stop-Flag Confidentiality Requirement Is Not Enforced
scripts/create-stop-flag.sh:15Unescaped Values Allow Stop-Flag JSON Injection and Corruption
The documented interrupt triggers include broad natural-language keywords like 停止 and 中断, which can easily appear in normal conversation or task content. This creates a control-channel ambiguity where an untrusted user message or quoted text may unintentionally abort active work, enabling denial of service or task disruption.
The example code clears the stop-flag using flag.sessionId parsed from the flag file rather than the agent's trusted this.sessionId. Because the flag file contents are attacker-controlled within the threat model, a crafted file could cause deletion of another session's flag or an unintended path under /tmp, undermining the documented session isolation and potentially interfering with other agents' interrupt handling.
The file's operational instructions and user-facing guidance are presented exclusively in Chinese, with no opt-in or alternative language path. That creates a language-policy concern because it constrains use to a specific language without documenting that the skill is region-specific or allowing the user to choose another locale.
The skill describes interruption as being triggered by checking a flag file, but later the example adds SIGINT-based termination. This mismatch is dangerous because operators or downstream agents may assume a graceful, checkpoint-aware stop path while the implementation may instead interrupt execution asynchronously, causing inconsistent state, partial writes, or skipped cleanup.
The instructions describe sending SIGINT to a running process without clearly warning about interruption side effects such as partial work, lost state, aborted I/O, or termination of the wrong process if PID tracking is stale. Because this skill is specifically about task interruption, adding process-level signaling makes the skill more dangerous than a normal documentation omission.
The documented design says interruption is handled through polling a stop-flag file and checkpointing, but the integration example additionally sends SIGINT to a running process. Introducing process signaling expands the capability from cooperative cancellation to forceful process control, which can terminate the wrong process if session-to-PID mapping is incorrect and can bypass graceful cleanup assumptions.
The skill title and operational examples are presented in Chinese, and the trigger examples emphasize Chinese commands and messages without indicating multilingual support or user opt-in. This can constitute a language policy issue if the organization expects skills not to force a specific language by default.
The manifest description uses Chinese text exclusively and does not indicate that the skill is region-specific or that users can choose another language. This can violate language/locale policy expectations when skills are expected to be accessible without forcing a specific language absent user opt-in.
This markdown file describes creating, checking, and automatically clearing /tmp/agent-stop-{sessionId}.flag, which is a file-write/delete behavior affecting system state. The document explains the mechanism technically but does not warn users that the skill will create and remove local files as part of interruption handling.
This shell script contains user-facing comments and usage documentation in Chinese, while also emitting English output elsewhere. The file provides no indication that the language choice is optional or justified for a region-specific tool, which can violate a language/locale policy requiring user choice or clear documentation.
The file includes user-facing natural-language comments in Chinese only, with no indication that the skill is intentionally region-specific or that another language option is available. This can violate language/locale policy when a skill implicitly forces a specific language without user opt-in or justification.