Back to skill

Security audit

Task Interrupt Pro

Security checks for vulnerabilities and agentic risk

Overview

The skill is genuinely aimed at stopping stuck agent tasks, but it uses broad stop triggers and unsafe shared temporary files that make it risky on shared or sensitive systems.

Review before installing. Use this only where users intentionally need an agent-task kill switch, run it as an ordinary user, avoid shared or privileged hosts until the /tmp file handling is fixed, and require explicit confirmation or narrower commands before sending termination signals. Expect that forced termination can lose unsaved work or leave partial state.

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 (4)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/handle-stop.sh:176
Finding

TOCTOU Symlink Race in Stop-Flag Creation

Content
View full analysis
"${FLAG_FILE}" << EOF { "sessionId": "${SESSION_ID}", "timestamp": $(date +%s%3N), "reason": "${REASON_ESCAPED}", "signal": "SIGINT", "createdBy": "${CURRENT_USER}", "version": "1.0.2" } EOF chmod 0600 "${FLAG_FILE}" ``` ### Technical Analysis The stop flag uses a predictable path under the shared `/tmp` directory. Although the script rejects a symbolic link before writing, the symbolic-link check and the subsequent file creation are separate filesystem operations. A local attacker can replace the checked path with a symbolic link after the `-L` test succeeds but before the shell processes the output redirection. This is a classic time-of-check/time-of-use race. Shell redirection follows symbolic links, so the destination file would be opened and truncated using the privileges of the account running the skill. The subsequent `chmod 0600` can also follow the substituted path and modify the target file's permissions. ### Attack Path 1. The attacker predicts or learns the session ID. 2. The attacker monitors `/tmp/agent-stop-.flag`. 3. The interruption script checks that the path is not a symbolic link. 4. Before the `cat > "${FLAG_FILE}"` redirection occurs, the attacker creates or replaces that path with a symbolic link to a victim file. 5. The script follows the symbolic link and truncates or overwrites the victim file. 6. The script may set the victim file's permissions to `0600`. Successful exploitation requires local filesystem access and the ability to win the race. The target must be writable by the accou ...[truncated 528 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

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

Arbitrary File Overwrite Through Unsafe Stop-Flag Helper

Content
View full analysis
[reason]" exit 1 fi FLAG_FILE="/tmp/agent-stop-${SESSION_ID}.flag" cat > "$FLAG_FILE" << EOF { "sessionId": "$SESSION_ID", "timestamp": $(date +%s000), "reason": "$REASON" } EOF ``` ### Technical Analysis The helper writes directly to a predictable path in the shared `/tmp` directory without checking whether the path is a symbolic link and without using exclusive file creation. If an attacker pre-creates the flag path as a symbolic link, shell redirection follows it and truncates the linked target. The helper also does not validate `SESSION_ID`. Unlike the core interruption script, it does not enforce the expected `^[a-z0-9]+-[a-z0-9]+$` format. Path separators and other unexpected characters can therefore influence path resolution when corresponding intermediate directories exist. Finally, `SESSION_ID` and `REASON` are inserted directly into JSON without escaping quotes, backslashes, control characters, or newlines. Crafted input can break the JSON structure or inject additional fields. This primarily affects flag integrity, but may become more significant if another component later treats the file as trusted JSON. ### Attack Path 1. The attacker predicts the session ID that an operator or agent will pass to the helper. 2. The attacker creates `/tmp/agent-stop-.flag` as a symbolic link to a victim file writable by the helper's execution account. 3. The helper is invoked with the predicted session ID. 4. The shell follows the symbolic link while processing `cat > "$FLAG_FILE"`. 5. The target file is truncated and replaced with attacker-influenced flag content. Alte ...[truncated 1095 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/task-template.sh:52
Finding

PID and Lock File Symlink Attacks in Task Template

Content
View full analysis
/dev/null 2>&1; then # 有flock,用原子锁写入 flock -n 200 -c "echo $$ > '${PID_FILE}' && chmod 0600 '${PID_FILE}'" 200>"${PID_FILE}.lock" 2>/dev/null || { echo "[TEMPLATE] flock锁定失败,使用直接写入" echo $$ > "${PID_FILE}" chmod 0600 "${PID_FILE}" } else # 无flock,直接写入 echo $$ > "${PID_FILE}" chmod 0600 "${PID_FILE}" fi } ``` ### Technical Analysis Both `${PID_FILE}` and `${PID_FILE}.lock` use predictable names in `/tmp`. The lock-file redirection and PID-file redirection follow symbolic links. `flock` only coordinates processes that cooperate by locking the same opened object. It does not make pathname resolution safe, prevent symbolic-link traversal, or guarantee exclusive secure file creation. Consequently, an attacker can prepare either predictable path as a symbolic link before the task starts. The fallback is especially problematic because any lock failure causes an unconditional direct write to the PID path. This preserves availability at the cost of bypassing the intended locking protection. The PID write truncates the target and replaces its contents with the shell PID. The subsequent `chmod 0600` may also change the target file's permissions. ### Attack Path 1. The attacker predicts or learns the task's session ID. 2. Before the task template starts, the attacker creates one of the following: - `/tmp/agent-pid-.pid` as a symbolic link to a victim file; or - `/tmp/agent-pid-.pi ...[truncated 1140 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/handle-stop.sh:17
Finding

Shared Audit Log Allows Symlink Redirection and Log Forgery

Content
View full analysis
> "${AUDIT_LOG}" 2>/dev/null || true } ``` The same logging pattern also appears in `scripts/task-template.sh` at lines 19 and 37–42: ```bash AUDIT_LOG="/tmp/agent-interrupt-audit.log" audit_log() { local status="$1" local msg="$2" local timestamp timestamp=$(date '+%Y-%m-%d %H:%M:%S') echo "${timestamp} | ${status} | SESSION:${SESSION_ID} | PID:$$ | ${msg}" >> "${AUDIT_LOG}" 2>/dev/null || true } ``` ### Technical Analysis The audit log has a fixed, predictable name in a world-writable shared directory. The scripts append to the path without verifying its type, ownership, or symbolic-link status and without opening it with no-follow protection. A local attacker can pre-create `/tmp/agent-interrupt-audit.log` as a symbolic link to another file. When the script logs an event, shell append redirection follows the symbolic link and writes with the privileges of the script runner. In `handle-stop.sh`, the user-supplied `REASON` is inserted into the log verbatim. Newline and carriage-return characters are not escaped. A crafted reason can therefore create fake lines that resemble legitimate audit events. This compromises audit-log integrity even when no symbolic-link attack occurs. ### Attack P ...[truncated 1246 chars]
Remediation
View remediation
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (20)

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

The documentation presents the skill as a stop/interruption mechanism, but it also documents companion scripts that can clear stop flags and modify control state in /tmp. That mismatch is security-relevant because a user or agent may trust the skill as purely destructive/interruption-only, while it can also alter the stop state and potentially allow tasks to continue or be resumed unexpectedly.

Content

No source excerpt is available for this finding.

Chaining Abuse

High
Category
Tool Misuse
Confidence
75% confidence
Finding

Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Content

Scanner excerpt · SKILL.md (reported line 120)May include surrounding context.

md
chmod 0600 "${PID_FILE}"

# 信号处理(收到 SIGINT/SIGTERM 时优雅退出)
trap 'echo "[TRAP] 收到停止信号"; rm -f "${PID_FILE}"; exit 0' SIGINT SIGTERM

# 主循环(每轮检查 flag)
while true; do

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 141)May include surrounding context.

md
**路径**: `scripts/handle-stop.sh`

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 200)May include surrounding context.

md
**路径**: `scripts/handle-stop.sh`

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 388)May include surrounding context.

md
**路径**: `scripts/handle-stop.sh`

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill explicitly describes shell-script-based process control but does not declare any tool scope or allowed-tools restrictions. In an agent ecosystem, undeclared shell capability increases the chance that the skill executes with broader privileges than reviewers or policy expect, making process killing and /tmp state manipulation harder to constrain.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill documents escalation to SIGKILL but does not prominently warn that forced termination can cause data loss, partial writes, corrupted temporary state, or inconsistent downstream workflows. For a process-control skill, omitting this warning increases operational risk because users may invoke it casually without understanding the consequences.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

Broad symptom phrases like '进程卡住了' or '任务无响应' can trigger an interruption flow without an explicit, unambiguous stop command. In a multi-agent setting this raises the risk of accidental denial of service, where normal conversational troubleshooting language causes unintended termination of active work.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The workflow says to detect keywords such as '停止' plus an agent name rather than exact trigger phrases. Keyword-based matching for destructive process control is dangerous because it can fire on incidental text, quoted examples, or discussions about stopping, causing unintended process interruption.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The trigger list includes broad natural-language phrases such as '停止我的任务', 'agent任务卡住', and '进程无响应' that can plausibly occur during ordinary conversation about troubleshooting. In a skill that interrupts or kills running subtask processes, accidental activation could terminate legitimate work, causing loss of progress or denial of service to the current agent workflow.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The manifest description defines the skill and its triggers entirely in Chinese, with no indication that users may invoke it in other languages or that the skill is intentionally limited to a Chinese-speaking context. This creates a language/locale constraint without visible opt-in or justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file’s natural-language comments, usage text, and runtime messages are entirely in Chinese, including error and help output shown to users. Under the stated policy, forcing a specific language without opt-in or justification is a locale-policy violation.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/task-template.sh (reported line 49)May include surrounding context.

sh
# 目录创建
# ------------------------------------------------------------------------------
mkdir -p "${PID_DIR}" 2>/dev/null || true
chmod 0755 "${PID_DIR}" 2>/dev/null || true

# ------------------------------------------------------------------------------
# PID文件写入(使用flock原子锁,防止竞争条件)

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · SKILL.md (reported line 117)May include surrounding context.

md
write_pid() {
    if command -v flock >/dev/null 2>&1; then
        # 有flock,用原子锁写入
        flock -n 200 -c "echo $$ > '${PID_FILE}' && chmod 0600 '${PID_FILE}'" 200>"${PID_FILE}.lock" 2>/dev/null || {
            echo "[TEMPLATE] flock锁定失败,使用直接写入"
            echo $$ > "${PID_FILE}"
            chmod 0600 "${PID_FILE}"

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/handle-stop.sh (reported line 193)May include surrounding context.

sh
write_pid() {
    if command -v flock >/dev/null 2>&1; then
        # 有flock,用原子锁写入
        flock -n 200 -c "echo $$ > '${PID_FILE}' && chmod 0600 '${PID_FILE}'" 200>"${PID_FILE}.lock" 2>/dev/null || {
            echo "[TEMPLATE] flock锁定失败,使用直接写入"
            echo $$ > "${PID_FILE}"
            chmod 0600 "${PID_FILE}"

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/task-template.sh (reported line 57)May include surrounding context.

sh
write_pid() {
    if command -v flock >/dev/null 2>&1; then
        # 有flock,用原子锁写入
        flock -n 200 -c "echo $$ > '${PID_FILE}' && chmod 0600 '${PID_FILE}'" 200>"${PID_FILE}.lock" 2>/dev/null || {
            echo "[TEMPLATE] flock锁定失败,使用直接写入"
            echo $$ > "${PID_FILE}"
            chmod 0600 "${PID_FILE}"

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/task-template.sh (reported line 60)May include surrounding context.

sh
write_pid() {
    if command -v flock >/dev/null 2>&1; then
        # 有flock,用原子锁写入
        flock -n 200 -c "echo $$ > '${PID_FILE}' && chmod 0600 '${PID_FILE}'" 200>"${PID_FILE}.lock" 2>/dev/null || {
            echo "[TEMPLATE] flock锁定失败,使用直接写入"
            echo $$ > "${PID_FILE}"
            chmod 0600 "${PID_FILE}"

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/task-template.sh (reported line 65)May include surrounding context.

sh
write_pid() {
    if command -v flock >/dev/null 2>&1; then
        # 有flock,用原子锁写入
        flock -n 200 -c "echo $$ > '${PID_FILE}' && chmod 0600 '${PID_FILE}'" 200>"${PID_FILE}.lock" 2>/dev/null || {
            echo "[TEMPLATE] flock锁定失败,使用直接写入"
            echo $$ > "${PID_FILE}"
            chmod 0600 "${PID_FILE}"

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

The documented invocation phrases and instructions are presented only in Chinese, and the skill behavior appears keyed to those Chinese phrases. The file does not offer alternative language options or state that the skill is intentionally limited to a Chinese-only environment, which is a locale policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The natural-language comments describing the script's purpose, usage, and behavior are written only in Chinese. Under the stated policy, forcing a specific language without user opt-in can be a locale/language policy violation, and this file does not offer an alternative language or explain a justified locale restriction.

Content

No source excerpt is available for this finding.