Back to skill

Security audit

任务打断机制

Security checks for vulnerabilities and agentic risk

Overview

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.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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
Findings (5)

T09 · Insecure Skill Coding Practices

Error
Location
instructions.md:97
Finding

Shell Command Injection in Recommended Stop-Command Integration

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:443
Finding

Unvalidated Session Identifier Enables Recursive Path Deletion

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/create-stop-flag.sh:13
Finding

Predictable Stop-Flag Path Permits Symlink-Based File Overwrite

Content
View full analysis
"$FLAG_FILE" << EOF { "sessionId": "$SESSION_ID", "timestamp": $(date +%s000), "reason": "$REASON" } EOF ``` ### Technical Analysis The script writes to a predictable pathname in the shared `/tmp` directory. The shell redirection opens the destination without exclusive creation and follows symbolic links. A local attacker who can predict or discover a session identifier can create the expected flag path as a symbolic link to another file. When the trusted agent invokes the script, the redirection follows the link, truncates the target, and writes the generated flag data into it. Quoting `"$FLAG_FILE"` prevents shell word splitting but does not prevent symlink traversal, pathname races, or pre-creation attacks. The check and creation must be atomic and must explicitly reject symbolic links. ### Attack Path 1. A local attacker predicts or obtains a target session identifier. 2. The attacker creates `/tmp/agent-stop-{sessionId}.flag` as a symbolic link to a file writable by the agent account. 3. The main agent invokes `create-stop-flag.sh` for that session. 4. Shell redirection follows the attacker's symbolic link. 5. The linked file is truncated and replaced with stop-flag JSON content. ### Impact Assessment The attacker can overwrite or corrupt files writable by the account running the script. If the script is invoked by a more privileged account, the overwrite may cross the attacker's normal permission boundary. The exact consequences depend on the selected target and invoking privileges. Potential outcomes include denial of service, configuration corruption, state loss, or modification of files later consumed by another trusted component. ]]>
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/create-stop-flag.sh:13
Finding

Stop-Flag Confidentiality Requirement Is Not Enforced

Content
View full analysis
"$FLAG_FILE" << EOF { "sessionId": "$SESSION_ID", "timestamp": $(date +%s000), "reason": "$REASON" } EOF ``` The skill documentation states that flag files should have mode `0600`, but the script neither sets a restrictive `umask` nor explicitly changes the created file's permissions. ### Technical Analysis Shell redirection creates the destination according to the process's current `umask`. Under a common `022` umask, a newly created regular file may have mode `0644`, making its contents readable by other local users. The predictable location under `/tmp` further simplifies discovery. Flag contents include a session identifier, interruption timestamp, and reason. The create and check scripts also print the complete file contents to standard output, potentially propagating that metadata into logs. ### Attack Path 1. The agent invokes the script under a permissive `umask`. 2. The stop-flag file is created with group-readable or world-readable permissions. 3. Another local user discovers the predictable pathname. 4. That user reads the session identifier, timing information, and interruption reason. 5. The same information may additionally be captured by shared command logs because the scripts print the file. ### Impact Assessment The direct impact is local information disclosure. Exposed session identifiers and operational metadata may help an attacker correlate active tasks, time further attacks, or target related predictable files. No credentials are shown in the audited code, but callers may supply sensitive text as the interruption reason, increasing the confidentiality impact. ]]>
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/create-stop-flag.sh:15
Finding

Unescaped Values Allow Stop-Flag JSON Injection and Corruption

Content
View full analysis
"$FLAG_FILE" << EOF { "sessionId": "$SESSION_ID", "timestamp": $(date +%s000), "reason": "$REASON" } EOF ``` ### Technical Analysis `SESSION_ID` and `REASON` are inserted directly into JSON string literals without JSON encoding. Characters such as double quotes, backslashes, carriage returns, and newlines can terminate or corrupt the intended strings. A crafted value can make the document invalid or inject additional JSON properties. Consumers shown elsewhere in the skill call `JSON.parse()` on the file, so malformed data can prevent interruption processing. If duplicate or injected fields are accepted by a consumer, the attacker may also alter the interpreted reason, session identifier, or other metadata. Shell quoting does not solve JSON encoding. Data must be serialized according to JSON rules by a proper serializer. ### Attack Path 1. An attacker influences the session identifier or interruption reason. 2. The value includes JSON metacharacters, embedded quotes, or newlines. 3. The script inserts the value verbatim into the here-document. 4. The resulting flag is malformed or contains attacker-injected fields. 5. The polling consumer attempts to parse or trust the manipulated document. 6. Parsing fails, preventing the expected interrupt, or manipulated metadata is processed and logged. ### Impact Assessment The most direct impact is denial of service against the interruption mechanism: the agent may continue a long-running or stuck task because it cannot parse the stop flag. Additional effects include forged interruption metadata, misleading logs, and inconsistent cleanup behavior. This issue does not by itself establish arbitrary command execution because the values are written as data, but it undermines the in ...[truncated 57 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (11)

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

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.

Content

No source excerpt is available for this finding.