Back to skill

Security audit

Claude Handoff

Security checks for vulnerabilities and agentic risk

Overview

The skill has a coherent handoff purpose, but it automatically persists and can transmit task and project metadata in ways that are under-scoped and under-disclosed.

Install only if you are comfortable with local handoff files containing task details and project context. Before use, unset or tightly control OPENCLAW_NOTIFY_ENDPOINT, review generated handoffs for secrets before sending them to Claude Code, and avoid pasting the generated shell command from projects with unusual or untrusted path names.

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

T09 · Insecure Skill Coding Practices

Error
Location
claude_handoff.py:238
Finding

Unrestricted Notification Endpoint Can Exfiltrate Task and Project Metadata

Content
View full analysis

Vulnerability Details

File Location: claude_handoff.py:238-247 and claude_handoff.py:306-313
Vulnerability Type: Sensitive information transmission to an unvalidated network destination
Risk Level: High

Vulnerable Code

python
openclaw_endpoint = os.environ.get("OPENCLAW_NOTIFY_ENDPOINT")
if openclaw_endpoint:
    try:
        import urllib.request
        data = json.dumps({"title": title, "body": body, "level": "info"}).encode()
        req = urllib.request.Request(
            openclaw_endpoint, data=data,
            headers={"Content-Type": "application/json"},
        )
        urllib.request.urlopen(req, timeout=5)
    except Exception as e:
        print(f"[notify] OpenClaw notify failed: {e}", file=sys.stderr)

The transmitted notification is constructed as follows:

python
command = f'cd {project.absolute()} && claude "Read {relative_path} and implement the plan"'

summary = f"Handoff ready: {summarize_task(task)} → Claude Code"

notify_user(
    title="🤖 Claude Code handoff ready",
    body=f"{summary}\n\nPath: {relative_path}\n\nRun:\n  {command}",
)

Technical Analysis

When OPENCLAW_NOTIFY_ENDPOINT is present, the Skill automatically sends an HTTP POST request to the environment-provided URL. The destination is not restricted to an approved origin, HTTPS is not required, and no user confirmation is requested before transmission.

The payload includes:

  • A summary derived from the first sentence of the user-provided task.
  • The relative handoff path.
  • A command containing the absolute project path.
  • Potentially identifying repository, directory, and username information embedded in that path.

An environment variable is not a sufficient trust boundary. It may be inherited from a parent process, deployment configuration, shell profile, compromised integration, or other component. The implementation also uses the default URL opener behavior without explicitly restricting redirects, allowing an in ...[truncated 1986 chars]

Remediation
View remediation

Remediation Suggestions

  1. Make network notification disabled by default and require explicit user opt-in.
  2. Display the destination and exact payload before sending task-derived information.
  3. Maintain an allowlist of trusted notification origins rather than accepting an unrestricted URL.
  4. Require HTTPS and reject URLs containing credentials, unexpected ports, loopback targets, link-local targets, or unsupported schemes.
  5. Disable redirects or validate every redirect target against the same allowlist.
  6. Remove the task summary and absolute project path from remote notifications. Use a generic message such as “A local handoff is ready.”
  7. If path information is necessary, transmit only a non-sensitive identifier or basename after explicit approval.
  8. Separate local status-file generation from remote notification so the core handoff function requires no network privilege.
  9. Document clearly that configured messaging channels may receive task-derived metadata.
  10. Add tests verifying that no network request occurs without explicit consent and that untrusted destinations are rejected.

T09 · Insecure Skill Coding Practices

Warning
Location
claude_handoff.py:306
Finding

Shell Command Injection Through Unquoted Project Path

Content
View full analysis

Vulnerability Details

File Location: claude_handoff.py:306
Vulnerability Type: Shell command injection in a generated copy-and-paste command
Risk Level: Medium

Vulnerable Code

python
command = f'cd {project.absolute()} && claude "Read {relative_path} and implement the plan"'

This command is subsequently presented to the user:

python
notify_user(
    title="🤖 Claude Code handoff ready",
    body=f"{summary}\n\nPath: {relative_path}\n\nRun:\n  {command}",
)

It is also returned to the caller:

python
return {
    "handoff_path": str(handoff_path.absolute()),
    "command": command,
    "summary": summary,
}

Technical Analysis

The Skill interpolates project.absolute() directly into shell syntax without quoting or escaping it. The project root originates from the --project-root argument or the programmatic project_root parameter.

Although the Skill does not execute this command itself, it explicitly advertises the value as a ready-to-run command. If the project path contains shell metacharacters, command substitutions, whitespace, or control operators, a user who pastes the command into a shell may execute unintended commands.

For example, a directory component containing shell command substitution syntax could be evaluated when the generated command is run. Characters such as spaces can also alter command parsing even without a deliberate attack. The relative handoff path is inside double quotes but is likewise not safely encoded for every possible filename; shell substitutions remain meaningful inside double quotes.

This is a command-construction vulnerability at a delayed execution boundary: the Skill produces the unsafe command, while exploitation occurs when the user or another automation component executes it.

Attack Path

  1. An attacker supplies or influences a project directory whose path contains shell-significant characters.
  2. The Skill is invoked with that directory through `--pro ...[truncated 1084 chars]
Remediation
View remediation

Remediation Suggestions

  1. Quote every shell argument with shlex.quote():
python
import shlex

project_arg = shlex.quote(str(project.absolute()))
prompt = f"Read {relative_path} and implement the plan"
command = f"cd -- {project_arg} && claude {shlex.quote(prompt)}"
  1. Prefer returning structured execution data instead of shell text:
python
{
    "cwd": str(project.absolute()),
    "argv": ["claude", f"Read {relative_path} and implement the plan"]
}
  1. If the command is executed programmatically, use subprocess.run() with an argument list, cwd=project, and shell=False.
  2. Validate that the handoff path remains beneath the resolved project root.
  3. Clearly label generated shell text as requiring review rather than presenting it as inherently safe.
  4. Add tests using project paths containing spaces, quotes, semicolons, dollar signs, backticks, newlines, and command-substitution syntax.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Rogue AgentSelf-Modification, Session Persistence
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (14)

Tainted flow: 'req' from os.environ.get (line 243, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
93% confidence
Finding

The code sends notification content to a URL taken directly from the OPENCLAW_NOTIFY_ENDPOINT environment variable with no validation or allowlisting. While the payload is only title/body metadata, this still creates an attacker-influenced outbound network sink and can exfiltrate task summaries or be abused for SSRF-like internal HTTP access if an attacker can control the environment.

Content

Scanner excerpt · claude_handoff.py (reported line 247)May include surrounding context.

python
openclaw_endpoint, data=data,
                headers={"Content-Type": "application/json"},
            )
            urllib.request.urlopen(req, timeout=5)
        except Exception as e:
            print(f"[notify] OpenClaw notify failed: {e}", file=sys.stderr)

Ssd 3

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The skill is explicitly designed to preserve the original user request and accumulated local context for transfer to another model. In security-sensitive repositories, that context can contain secrets, proprietary code, internal paths, or personal data, so bundling and forwarding it increases the risk of data exfiltration across trust boundaries.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

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

md
## Proposed approach (from local planning)

Sub-problems identified:
1. **Update deployment target to iOS 26** (AppDelegate, Info.plist)
2. **Add CloudKit entitlement** (project settings)
3. **Migrate UserDataSource to use CloudKit-backed ModelContainer**
   - Depends on sub-problem 1

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

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

text
Read /Users/stephen/projects/myapp/.openclaw-skills/handoffs/2026-04-21T14:32:18Z-add-swiftdata-cloudkit-migration.md

Then implement the 5 sub-problems in order. You have write access to the
project. Run `swift build` after each sub-problem to verify.

When done, produce a summary of what changed and any remaining concerns.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The template instructs passing the full handoff file to Claude Code and states that the target model has write access to the project. Even though invocation is manual, the handoff can contain verbatim requests, local findings, file lists, errors, and retrieved documentation, which may expose sensitive information to an external service and amplify the impact if the receiving model acts on untrusted embedded content.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The notification flow persists handoff-related data to a dashboard file and transmits it via external messaging channels. Persistent storage plus external transmission broadens the exposure surface, creating more copies of potentially sensitive task data and increasing the chance of unauthorized access or unintended retention.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill sends notification bodies through external messaging channels such as WhatsApp, Telegram, and Discord, and that body includes the handoff path and full runnable command. Because the handoff package is built from verbatim user input and gathered context, this design risks leaking sensitive project details or prompts to third-party services without a clear, explicit warning or opt-in at the skill level.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The documentation states the skill 'Adds entry to global handoff log at ~/.openclaw-skills/handoff-log.sqlite' and even defines a SQLite schema, but the executable code only writes the handoff markdown file and a last_notification.json status file. This is an active contradiction about actual side effects and persistence behavior, not merely omitted detail.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
82% confidence
Finding

The top-level documentation frames the skill as only writing a handoff package and not auto-invoking Claude Code. However, the code also sends a notification to an OpenClaw endpoint via urllib when OPENCLAW_NOTIFY_ENDPOINT is set, which is an externally observable network action not reflected in the stated behavior. While it does not auto-run Claude, the docstring still understates the actual operations performed.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The notification routine transmits notification text over the network when OPENCLAW_NOTIFY_ENDPOINT is set, but the behavior is not prominently disclosed to the user. Even if the payload seems limited, it includes task-derived summary/body content and can leak sensitive work context to external infrastructure unexpectedly.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The handoff file persists the full task, gathered context, retrieved docs, plans, and failure details to disk under the project directory without any consent gate, redaction, or sensitivity filtering. In a coding-agent setting, those fields can contain proprietary code references, internal paths, build errors, or user-provided secrets, so the local persistence meaningfully increases data exposure risk.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

The 'What handoff does NOT do' section says it 'only writes to .openclaw-skills/handoffs/', but notify_user also writes .openclaw-skills/last_notification.json. That contradicts the documented write scope of the skill's side effects.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

The docstring states that the function falls back to writing a file and printing to stderr if the OpenClaw notification API is not reachable. In practice, lines L251-L259 always write the status file and print to stderr even when the API call succeeds, so the documented conditional behavior contradicts the implementation. This is a direct intent-code divergence in the function's documentation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The script logs handoff metadata such as timestamp, task slug, reason, project root, and token estimates into a persistent SQLite database in the user's home directory without explicit notice. This is lower severity than content exfiltration, but it still creates privacy and operational exposure by leaving durable records of project activity and paths.

Content

No source excerpt is available for this finding.