T03 · Remote Payload Retrieval and Execution
- Location
references/sandbox/patterns.md:40- Finding
Unverified Remote Installation Script Is Piped Directly to a Shell
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This Cloudflare deployment skill is not clearly malicious, but it bundles broad infrastructure-changing and code-execution guidance with weak guardrails, so it should be reviewed before use.
Install only if you are comfortable with a broad Cloudflare infrastructure assistant. Use least-privilege Cloudflare tokens, pin Wrangler locally, and require explicit approval before destructive API calls, secret changes, sandbox code execution, public port exposure, or persistent tunnel service installation.
references/sandbox/patterns.md:40Unverified Remote Installation Script Is Piped Directly to a Shell
references/tunnel/patterns.md:181Cloudflare Tunnel Is Installed as a Persistent Privileged Host Service
SKILL.md:20Unpinned Wrangler Execution Introduces a Mutable Package Supply Chain
references/pages-functions/api.md:115Pages Function Example Returns an API Key in an HTTP Response
The sample logs the raw x-api-key header value into the analytics index field. API keys are secrets; storing them in analytics creates credential exposure risk through logs, dashboards, exports, query APIs, and broader operator access, potentially enabling unauthorized use if the data is disclosed.
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
GET /operations/{op_id} # Get single POST /operations/item # Create: {endpoint,host,method} POST /operations # Bulk: {operations:[{endpoint,host,method}]} DELETE /operations/{op_id} # Delete DELETE /operations # Bulk delete: {operation_ids:[...]}
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
POST /operations/item # Create: {endpoint,host,method} POST /operations # Bulk: {operations:[{endpoint,host,method}]} DELETE /operations/{op_id} # Delete DELETE /operations # Bulk delete: {operation_ids:[...]}
## Discovery
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
- dev: Uses `preview_id` or local bindings, secrets not available
- deploy: Uses production `id`, secrets available
**Access secrets in dev:** `npx wrangler dev --remote`
**Persist local data:** `npx wrangler dev --persist`
## Performance Gotchas
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
GET /accounts/{account_id}/images/v1/{image_id} # Get details
DELETE /accounts/{account_id}/images/v1/{image_id} # Delete
GET /accounts/{account_id}/images/v1?page=1 # List
The documentation exposes a destructive DELETE interconnect endpoint with no indication that callers should require strong validation or explicit user confirmation before use. In an agent skill context, this materially increases the risk of parameter abuse or accidental deletion of production network connectivity if an LLM constructs or forwards a request using attacker-influenced identifiers.
GET /accounts/{account_id}/cni/interconnects/{icon} GET /accounts/{account_id}/cni/interconnects/{icon}/status GET /accounts/{account_id}/cni/interconnects/{icon}/loa # Returns PDF DELETE /accounts/{account_id}/cni/interconnects/{icon}
**Create Body:** `account`, `slot_id`, `type`, `facility`, `speed`, `name`, `description`
The DELETE CNI endpoint can remove BGP configuration objects that underpin connectivity, yet the reference provides no guardrails around parameter validation, authorization scope, or confirmation. In a deployment skill, such undocumented destructive capability is dangerous because an agent may be induced to target the wrong CNI object, causing outages or routing disruption.
POST /accounts/{account_id}/cni/cnis GET /accounts/{account_id}/cni/cnis/{cni} PUT /accounts/{account_id}/cni/cnis/{cni} DELETE /accounts/{account_id}/cni/cnis/{cni}
Body: `account`, `cust_ip`, `cf_ip`, `bgp_asn`, `bgp_password`, `vlan`
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
// ❌ DANGEROUS: Path traversal
const key = url.pathname.slice(1); // Could be ../../../etc/passwd
await env.MY_BUCKET.get(key);
// ✅ SAFE: Validate keys
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
GET /meetings/{meeting_id}/participants/{participant_id} # Get details POST /meetings/{meeting_id}/participants # Add: {"name": "...", "preset_name": "...", "custom_participant_id": "..."} PATCH /meetings/{meeting_id}/participants/{participant_id} # Update: {"name": "...", "preset_name": "..."} DELETE /meetings/{meeting_id}/participants/{participant_id} # Delete POST /meetings/{meeting_id}/participants/{participant_id}/token # Refresh token
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
GET /webhooks # List all POST /webhooks # Create: {"url": "https://...", "events": ["session.started", "session.ended"]} PATCH /webhooks/{webhook_id} # Update DELETE /webhooks/{webhook_id} # Delete
## Session Lifecycle
This reference introduces a sandbox product centered on isolated code execution, including running untrusted code and agent-integrated execution, which is materially broader than a Cloudflare deployment skill. In a deployment-focused skill, bundling guidance for sandboxed execution expands the agent's operational scope toward remote code execution and increases the chance the agent will select or justify dangerous actions unrelated to simple deploy/publish tasks.
Including unjustified remote code execution and interactive sandbox use cases in a deployment-focused skill creates a dangerous mismatch between declared purpose and actual capabilities. Because the skill is supposed to help deploy to Cloudflare, this context makes the presence of untrusted-code execution more suspicious and more likely to be abused or accidentally invoked under the guise of deployment assistance.
The documented APIs explicitly support command execution, file read/write, background process control, port exposure, WebSocket proxying, and storage mounting. Those capabilities exceed normal deployment semantics and could enable an agent to execute arbitrary code, modify files, run persistent services, or expose internal applications if the reference is used as part of the skill's available action surface.
The reference file documents multiple high-risk capabilities—arbitrary code execution, interactive IDE exposure, CI/CD execution, writable bucket mounting, WebSocket proxying, and Git operations—that substantially exceed the declared scope of a Cloudflare deployment skill. In a skill package, such references can normalize or encourage implementation of dangerous behaviors unrelated to the manifest, increasing the chance the agent is granted or develops broader execution and data-handling capabilities than intended.
This example accepts arbitrary code from a request and executes it in a sandbox, then returns rich outputs including HTML. Even if sandboxed, this creates a generic code-execution service that is unrelated to deployment tasks and can be abused for untrusted computation, payload staging, or generation of unsafe rendered content.
The example installs code-server via a remote shell script and exposes a browser-accessible IDE, effectively provisioning remote administrative access inside the sandbox. That is far beyond Cloudflare deployment scope and introduces a large attack surface including remote code execution, persistence, package installation, and possible lateral movement through connected credentials or mounted resources.
Using 'curl ... | sh' fetches and executes a remote script without integrity verification, making the environment trust whatever content is served at runtime. This creates a direct supply-chain execution path and is especially dangerous in a skill reference because it models unsafe behavior for provisioning a remotely exposed IDE.
const sandbox = getSandbox(env.Sandbox, 'ide', { normalizeId: true });
if (request.url.endsWith('/start')) {
await sandbox.exec('curl -fsSL https://code-server.dev/install.sh | sh');
await sandbox.startProcess('code-server --bind-addr 0.0.0.0:8080', {
processId: 'vscode'
});
This CI/CD example clones arbitrary repositories, installs dependencies, and runs tests, which effectively turns the skill into a build-execution system rather than a deployment helper. Executing repository contents and package install scripts is a well-known route to arbitrary command execution, secret exposure, and supply-chain compromise.
This multi-tenant pattern constructs a command from user-supplied code and executes it per user session, creating a direct arbitrary command-execution interface. In addition to being unrelated to Cloudflare deployment, multi-tenant execution amplifies risk through tenant isolation failures, abuse at scale, and command injection concerns.
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
{"name": "my-store"}
DELETE /accounts/{account_id}/secrets_store/stores/{store_id}
### Secret Operations
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
{"value": "new_value", "comment": "Updated"}
# Delete (single)
DELETE /accounts/{account_id}/secrets_store/stores/{store_id}/secrets/{secret_id}
# Delete (batch)
DELETE /accounts/{account_id}/secrets_store/stores/{store_id}/secrets
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
DELETE /accounts/{account_id}/secrets_store/stores/{store_id}/secrets/{secret_id}
# Delete (batch)
DELETE /accounts/{account_id}/secrets_store/stores/{store_id}/secrets
{"secret_ids": ["id-1", "id-2"]}
# Duplicate
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
--name MY_SECRET --scopes workers --remote
# Create (piped)
cat secret.txt | wrangler secrets-store secret create <store-id> \
--name MY_SECRET --scopes workers --remote
# List/get/update/delete
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
### "Module-Level Secret Access"
**Cause:** Attempting to access secrets during module initialization before env is available
**Solution:** Cache secrets in request scope only, not at module level
### "Secret not found in store"
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
}
### "Cannot access secret in local dev"
**Cause:** Attempting to access production secrets in local development environment
**Solution:** Create local-only secrets (without `--remote` flag) for development: `wrangler secrets-store secret create <store-id> --name API_KEY --scopes workers`
Detected: suspicious.exposed_secret_literal, suspicious.prompt_injection_instructions