Back to skill

Security audit

A cross-session handoff protocol for Claude Code and other AI agents. handoff is not a summarization tool. It's a protocol for freezing your work context, packaging it, and resuming execution — in any session, any agent, any device.

Security checks for vulnerabilities and agentic risk

Overview

The skill appears to be a legitimate cross-session handoff tool, but it needs review because it persistently stores work context, captures session metadata, recommends cloud-sync storage, and has weak path validation when restoring handoffs.

Install only if you are comfortable with task context being saved under ~/.agents/handoff_context. Avoid putting secrets, credentials, proprietary details, or sensitive customer data in handoff files; avoid cloud-sync paths unless that storage is trusted and access-controlled. Prefer explicit handoff commands and IDs, inspect restored handoff content before continuing, and fix ID validation/path containment before relying on this in shared or sensitive environments.

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

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/handoff_file.sh:159
Finding
Path Traversal in Handoff Package Resolution<![CDATA[ ## Vulnerability Details **File Location**: `scripts/handoff_file.sh:159-163` **Vulnerability Type**: Improper path validation and path traversal **Risk Level**: Medium ### Vulnerable Code ```bash resolve) id="${1:-}" [ -n "$id" ] || { echo "Usage: handoff_file.sh resolve <handoff_id>" >&2; exit 1; } target="$HANDOFF_ROOT/$id/handoff.md" [ -f "$target" ] || { echo "Handoff not found: $id" >&2; exit 1; } printf '%s\n' "$target" ;; ``` ### Technical Analysis The `resolve` operation directly interpolates the user-controlled `id` into a filesystem path without validating that it matches the generated handoff identifier format. It also does not canonicalize the resulting path or verify that it remains beneath `HANDOFF_ROOT`. An identifier containing traversal components such as `../` can therefore escape the configured handoff directory. The `[ -f "$target" ]` check only verifies that the resolved target is a regular file; it does not enforce the intended directory boundary. Symbolic links beneath `HANDOFF_ROOT` can produce the same boundary violation. Exploitation is constrained to accessible targets whose final filename is `handoff.md`, but a matching file outside the storage root can be resolved and subsequently read by the Agent. Because handoff documents are interpreted as persistent task state, an attacker-controlled document can also supply misleading constraints, file references, or next-step instructions. ### Attack Path 1. An attacker creates or identifies an accessible file outside `HANDOFF_ROOT` named `handoff.md`. 2. The attacker provides a crafted handoff identifier containing traversal components, for example: ```text handoff in ../../path/to/package ``` 3. The Skill invokes: ```bash scripts/handoff_file.sh resolve "../../path/to/package" ``` 4. The script constructs: ```text $HANDOFF_ROOT/../../path/to/package/handoff.md ``` 5. Because no canonical containment check is performed, the script ac ...[truncated 1207 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Validate the identifier against the exact generated format before using it: ```bash if [[ ! "$id" =~ ^[0-9]{8}-[0-9]{4}-[0-9a-f]{8}$ ]]; then echo "Invalid handoff ID." >&2 exit 1 fi ``` 2. Canonicalize both the storage root and target path, then enforce containment: ```bash root_real="$(realpath "$HANDOFF_ROOT")" target_real="$(realpath "$HANDOFF_ROOT/$id/handoff.md")" case "$target_real" in "$root_real"/*) ;; *) echo "Handoff path escapes storage root." >&2 exit 1 ;; esac ``` 3. Reject symbolic-link package directories or files if links are not required: ```bash package_dir="$HANDOFF_ROOT/$id" [ ! -L "$package_dir" ] || { echo "Symbolic-link handoff directories are not permitted." >&2 exit 1 } [ ! -L "$package_dir/handoff.md" ] || { echo "Symbolic-link handoff files are not permitted." >&2 exit 1 } ``` 4. Apply equivalent canonical-path and containment checks to all operations that enumerate, select, create, or read handoff packages. 5. Preserve the existing user-confirmation requirement before executing recovered actions, and clearly label handoff contents as untrusted persisted data rather than authoritative instructions. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Rogue AgentSelf-Modification, Session Persistence
  • 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 (12)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding
The skill advertises a tightly scoped handoff protocol, but the analysis indicates behavior that reaches beyond that contract by using different subcommands, extra storage structures, and scanning local session data outside the declared handoff artifact. That mismatch is dangerous because users and orchestrators may grant trust based on the stated design while the implementation persists or reads broader context than expected, creating a covert data-access and consent-bypass risk.

Ae1

High
Category
analysis-evasion
Content
2. 调用 `scripts/handoff_file.sh create "{主题}"`
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
2. 调用 `scripts/handoff_file.sh create "{主题}"`
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
2. 调用 `scripts/handoff_file.sh create "{主题}"`
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The README explicitly recommends storing handoff context in consumer cloud-sync folders without warning that handoff.md may contain sensitive project context, credentials, internal paths, or proprietary data. Because this skill is designed to preserve rich cross-session state and share it across agents/devices, syncing that state to third-party services or shared devices materially increases the risk of unintended disclosure or persistence outside the local trust boundary.

Natural-Language Policy Violations

Medium
Confidence
88% confidence
Finding
The manifest description and the entire operational guidance are written as mandatory Chinese-language instructions, including fixed Chinese trigger phrases, without indicating that users may opt into another language. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is explicit and justified.

Vague Triggers

Medium
Confidence
92% confidence
Finding
The `handoff out` trigger phrases are broad enough to match ordinary conversational pauses, which can cause the skill to activate and persist session state when the user did not intend a formal handoff. In a security-sensitive agent, accidental activation matters because it can capture and store working context, including sensitive task details, under ambiguous user intent.

Vague Triggers

Medium
Confidence
95% confidence
Finding
Treating generic phrases like 'continue the last one' as restore requests without strict boundaries can cause the agent to load prior session state when the user may mean something else. This is risky because it can reintroduce stale or sensitive context into the current conversation and may steer the agent into acting on previously stored instructions without sufficiently explicit user intent.

Session Persistence

Medium
Category
Rogue Agent
Content
按顺序执行:

1. 用一句话确定主题
2. 调用 `scripts/handoff_file.sh create "{主题}"`
3. 填满 8 个槽位
4. 做一次压缩,把不能帮助恢复执行的内容全部删掉
5. 做一次恢复检查:假设自己已经失忆,只靠这份文档能否继续干活
Confidence
83% confidence
Finding
The duplicated finding still points to the same underlying issue: the skill operationalizes durable session persistence through a scripted handoff creation flow. In agent environments, that is dangerous when not paired with strong minimization, access control, and lifecycle rules, because stored context can outlive the user's expectations and expand the blast radius of sensitive data exposure.

Session Persistence

Medium
Category
Rogue Agent
Content
按顺序执行:

1. 用一句话确定主题
2. 调用 `scripts/handoff_file.sh create "{主题}"`
3. 填满 8 个槽位
4. 做一次压缩,把不能帮助恢复执行的内容全部删掉
5. 做一次恢复检查:假设自己已经失忆,只靠这份文档能否继续干活
Confidence
83% confidence
Finding
The duplicated finding still points to the same underlying issue: the skill operationalizes durable session persistence through a scripted handoff creation flow. In agent environments, that is dangerous when not paired with strong minimization, access control, and lifecycle rules, because stored context can outlive the user's expectations and expand the blast radius of sensitive data exposure.

Missing User Warnings

Low
Confidence
88% confidence
Finding
The script enumerates session identifiers from environment variables and local session-log directories under the user's home directory without explicit consent or disclosure at runtime. In a handoff skill, session IDs and log associations can be sensitive metadata because they help correlate conversations and may reveal prior activity across tools or projects.

Missing User Warnings

Low
Confidence
91% confidence
Finding
The script creates a directory and writes a handoff.md file under HANDOFF_ROOT, which affects user data on disk. Although the behavior is implied by the command name, there is no confirmation prompt, warning message, or inline comment/docstring disclosing that running create will modify the filesystem.

Static analysis

No suspicious patterns detected.