Back to skill

Security audit

TryCloudflare Proxy Verify

Security checks for vulnerabilities and agentic risk

Overview

This skill does what it says, but it can publicly expose arbitrary local directories or services with weak containment and verification safeguards.

Install only if you are comfortable with a skill that can publish local files or services to a temporary public URL. Use it only with a dedicated export directory containing exactly what you intend to share, avoid home directories, project roots, credentials, private admin services, and sensitive localhost apps, and stop the tunnel when finished.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
Findings (3)

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
scripts/share_local_path.sh:12
Finding
HTTP file server binds to all network interfaces<![CDATA[ ## Vulnerability Details **File Location**: `scripts/share_local_path.sh`, line 12 **Vulnerability Type**: Unintended network exposure and insufficient access restriction **Risk Level**: Medium ### Vulnerable Code ```bash python3 -m http.server "$PORT" >/tmp/trycloudflare-file-server.log 2>&1 & ``` ### Technical Analysis Python's `http.server` binds to all available network interfaces by default when no `--bind` argument is supplied. Although the Cloudflare tunnel connects to `127.0.0.1`, the origin server is also directly accessible through the host's other network interfaces. The server exposes the entire directory selected through `SERVE_DIR`, including directory listings and every readable file below that directory. Its network exposure is therefore broader than the intended localhost-to-tunnel communication path and broader than the single `REL_PATH` printed by the script. ### Attack Path 1. A user runs the script with a directory containing the intended shared file and other readable files. 2. The Python HTTP server listens on `0.0.0.0` or the equivalent wildcard address at the selected port. 3. An attacker on a network capable of reaching the host identifies the open port. 4. The attacker connects directly to `http://HOST:PORT/`, bypassing the public tunnel URL. 5. The attacker uses directory listings or predictable paths to retrieve other files under `SERVE_DIR`. ### Impact Assessment A network-adjacent attacker may obtain unauthorized read access to files beneath the served directory. The process does not grant operating-system privileges beyond those of the invoking user, but it exposes every file that the HTTP server process can read under `SERVE_DIR`. The disclosure scope is particularly significant if the caller selects a home directory, project root, or another directory containing credentials, source code, or private artifacts. ]]>
Remediation
<![CDATA[ ## Remediation Suggestions Bind the origin server explicitly to the loopback interface: ```bash python3 -m http.server --bind 127.0.0.1 "$PORT" ``` Additionally: 1. Create a dedicated temporary export directory with restrictive permissions. 2. Copy only the intended file into that directory. 3. Reject directories as input unless directory-wide sharing is explicitly required. 4. Confirm that the chosen port is listening only on `127.0.0.1`. 5. Consider disabling directory listings or replacing `http.server` with a minimal handler that serves only the requested resource. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/share_local_path.sh:42
Finding
Public URL verification accepts HTTP error responses<![CDATA[ ## Vulnerability Details **File Location**: `scripts/share_local_path.sh`, lines 42-44 **Vulnerability Type**: Incomplete HTTP response validation **Risk Level**: Medium ### Vulnerable Code ```bash curl -I "$PUBLIC_URL/$REL_PATH" >/tmp/trycloudflare-final-head.txt echo "$PUBLIC_URL/$REL_PATH" wait ``` ### Technical Analysis By default, `curl` exits successfully after receiving an HTTP response even when the server returns an error status such as `404`, `403`, or `500`. The script uses `set -e`, but this does not detect HTTP failures unless `curl` is invoked with an option such as `--fail`. The response is written to a file but is never parsed. Consequently, the script does not confirm the expected success status, content type, or content length before labeling and printing the URL as verified. Redirects are also not explicitly followed or validated. This behavior conflicts with the skill's stated security rule that the exact public resource must respond successfully and match the expected response characteristics. ### Attack Path 1. The caller supplies an incorrect, missing, inaccessible, or improperly encoded relative path. 2. The public endpoint returns an HTTP error response such as `404 Not Found`. 3. `curl -I` receives the response and exits with status zero because transport communication succeeded. 4. The shell continues execution despite `set -e`. 5. The script prints the unavailable URL as though verification succeeded. ### Impact Assessment The flaw can cause invalid, inaccessible, or error-producing URLs to be distributed as verified resources. It does not directly grant additional system privileges, but it undermines the principal security guarantee of the skill and may result in availability failures, disclosure of unexpected error content, or reliance on an unverified redirect destination. ]]>
Remediation
<![CDATA[ ## Remediation Suggestions Use strict HTTP validation and do not print the URL unless every check succeeds. For example: ```bash FINAL_URL="$PUBLIC_URL/$REL_PATH" STATUS="$(curl \ --silent \ --show-error \ --location \ --fail \ --output /dev/null \ --write-out '%{http_code}' \ --head \ "$FINAL_URL")" [[ "$STATUS" == "200" ]] || { echo "Public URL verification failed with HTTP status $STATUS" >&2 exit 3 } echo "$FINAL_URL" ``` The implementation should also: 1. Verify the local origin before opening the tunnel. 2. Validate the final status code after redirects. 3. Restrict redirects to expected HTTPS destinations when redirects are permitted. 4. Compare `Content-Type` and `Content-Length` with expected values where practical. 5. URL-encode or safely construct the relative resource path. 6. Refuse to print the URL after any failed validation. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/share_local_path.sh:12
Finding
Predictable files in the shared temporary directory enable symlink attacks and cross-run interference<![CDATA[ ## Vulnerability Details **File Location**: `scripts/share_local_path.sh`, lines 12-42 **Vulnerability Type**: Unsafe temporary-file handling **Risk Level**: Medium ### Vulnerable Code ```bash python3 -m http.server "$PORT" >/tmp/trycloudflare-file-server.log 2>&1 & HTTP_PID=$! cleanup() { kill "$HTTP_PID" 2>/dev/null || true [[ -n "${CF_PID:-}" ]] && kill "$CF_PID" 2>/dev/null || true } trap cleanup EXIT cloudflared tunnel --url "http://127.0.0.1:$PORT" --no-autoupdate --protocol http2 >/tmp/trycloudflare-tunnel.log 2>&1 & CF_PID=$! PUBLIC_URL="" for _ in $(seq 1 30); do if grep -Eo 'https://[a-z0-9-]+\.trycloudflare\.com' /tmp/trycloudflare-tunnel.log >/tmp/trycloudflare-url.txt 2>/dev/null; then PUBLIC_URL=$(tail -n 1 /tmp/trycloudflare-url.txt) fi if grep -q 'Registered tunnel connection' /tmp/trycloudflare-tunnel.log 2>/dev/null && [[ -n "$PUBLIC_URL" ]]; then break fi sleep 1 done if [[ -z "$PUBLIC_URL" ]]; then echo "Failed to obtain verified public URL" >&2 exit 2 fi curl -I "$PUBLIC_URL/$REL_PATH" >/tmp/trycloudflare-final-head.txt ``` ### Technical Analysis The script uses fixed, predictable filenames in the globally writable `/tmp` directory: - `/tmp/trycloudflare-file-server.log` - `/tmp/trycloudflare-tunnel.log` - `/tmp/trycloudflare-url.txt` - `/tmp/trycloudflare-final-head.txt` Shell output redirection follows symbolic links. A local attacker can pre-create one of these paths as a symbolic link to another file writable by the user who later runs the script. Opening the redirection target may then truncate or overwrite that file. The shared filenames also create race conditions between concurrent script executions. One execution can overwrite another execution's logs or extracted URL, potentially causing incorrect tunnel information to be parsed and returned. ### Attack Path 1. A local attacker predicts one of the fixed `/tmp/trycloudflare-*` filenames. 2. The attacker creates a symbolic link at tha ...[truncated 979 chars]
Remediation
<![CDATA[ ## Remediation Suggestions Create a private, per-execution temporary directory and place all transient files inside it: ```bash TMP_DIR="$(mktemp -d)" chmod 700 "$TMP_DIR" SERVER_LOG="$TMP_DIR/file-server.log" TUNNEL_LOG="$TMP_DIR/tunnel.log" URL_FILE="$TMP_DIR/url.txt" HEAD_FILE="$TMP_DIR/final-head.txt" cleanup() { kill "$HTTP_PID" 2>/dev/null || true [[ -n "${CF_PID:-}" ]] && kill "$CF_PID" 2>/dev/null || true rm -rf -- "$TMP_DIR" } trap cleanup EXIT ``` Further hardening should include: 1. Set a restrictive `umask`, such as `umask 077`, before creating files. 2. Avoid shared fixed paths under `/tmp`. 3. Keep all run-specific state inside the private directory. 4. Ensure cleanup removes the temporary directory on normal exit and signals. 5. Where persistent output is unnecessary, parse process output directly rather than writing it to shared files. ]]>
Vulnerability Patterns
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (2)

Missing User Warnings

High
Confidence
97% confidence
Finding
The script starts a local HTTP server for an arbitrary directory and then exposes it through a public trycloudflare.com tunnel without any interactive confirmation, allowlist, authentication, or scope restriction. In this skill's context, that behavior is the core function, which makes the risk more acute: a user may intend to share one file or page, but the script actually publishes the whole served directory to the public internet, enabling unintended disclosure of adjacent files.

Lp3

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding
The skill instructs use of shell-capable actions (`python3 -m http.server`, `cloudflared`, `curl`) but does not declare any explicit tool scope or permission boundaries. Because this skill is specifically designed to expose machine-local files and services to the public internet, the lack of scoped tool declarations increases the risk of unintended data exposure, misuse of shell access, and unsafe invocation in contexts that did not intend network publication.

Static analysis

No suspicious patterns detected.