T09 · Insecure Skill Coding Practices
- 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-247andclaude_handoff.py:306-313
Vulnerability Type: Sensitive information transmission to an unvalidated network destination
Risk Level: HighVulnerable 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_ENDPOINTis 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
- Make network notification disabled by default and require explicit user opt-in.
- Display the destination and exact payload before sending task-derived information.
- Maintain an allowlist of trusted notification origins rather than accepting an unrestricted URL.
- Require HTTPS and reject URLs containing credentials, unexpected ports, loopback targets, link-local targets, or unsupported schemes.
- Disable redirects or validate every redirect target against the same allowlist.
- Remove the task summary and absolute project path from remote notifications. Use a generic message such as “A local handoff is ready.”
- If path information is necessary, transmit only a non-sensitive identifier or basename after explicit approval.
- Separate local status-file generation from remote notification so the core handoff function requires no network privilege.
- Document clearly that configured messaging channels may receive task-derived metadata.
- Add tests verifying that no network request occurs without explicit consent and that untrusted destinations are rejected.
