Back to skill

Security audit

Cloudflare Wrangler & Pages

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a Cloudflare operations reference, but it includes under-scoped credential handling and production-impacting commands that warrant manual review before installation.

Install only if you expect an agent to manage Cloudflare resources. Use least-privilege Cloudflare tokens, avoid letting the agent print or log secrets, replace the hard-coded account ID and bucket with verified user-specific targets, pin Wrangler, and require explicit confirmation before deletes, rollbacks, lifecycle changes, domain changes, or production deployments.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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 (2)

T08 · Insecure Dependencies

Warning
Location
SKILL.md:82
Finding

Unpinned Wrangler Dependency May Execute Unreviewed Registry Code

Content
View full analysis
Remediation
View remediation
``` 2. Commit `package.json` and the generated lockfile to source control. 3. Use `npm ci` in automated and security-sensitive environments to enforce the lockfile. 4. Invoke only the installed local binary and prohibit implicit downloads: ```bash npx --no-install wrangler pages deploy dist --project-name=my-project ``` 5. Apply npm provenance, integrity, registry allowlisting, and dependency-scanning controls where available. 6. Use a narrowly scoped Cloudflare API token limited to the necessary account, project, and operations. 7. Avoid exposing the token to installation steps. Install and verify dependencies before exporting deployment credentials. 8. Document and periodically review the approved Wrangler version and dependency tree. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:33
Finding

Hard-Coded Cloudflare Targets Can Cause Cross-Environment Deployment or Destructive Retention Changes

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Rogue AgentSelf-Modification, Session Persistence
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (20)

Credential Access

High
Category
Privilege Escalation
Confidence
88% confidence
Finding

The skill explicitly identifies a local secrets file path and schema containing API and R2 credentials. In an agent setting, documenting exact secret locations materially increases the chance that downstream automation or prompt injection attempts will target those files for retrieval, leading to credential compromise and broad account access.

Content

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

R2 Configuration

Credentials stored in ~/.openclaw/secrets.json under cloudflare.r2:

json
{

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

The Node.js example directly reads ~/.openclaw/secrets.json to load R2 credentials, normalizing programmatic access to stored secrets. In a hostile prompt environment, examples like this increase the likelihood that an agent will be induced to access and potentially expose secret contents under the guise of following the skill.

Content

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

md
import { getSignedUrl } from "@aws-sdk/s3-request-presigner";
import { readFileSync } from "fs";

const { cloudflare: { r2 } } = JSON.parse(readFileSync(`${process.env.HOME}/.openclaw/secrets.json`));

const client = new S3Client({
  region: "auto",

Credential Access

High
Category
Privilege Escalation
Confidence
89% confidence
Finding

The prerequisites section states exactly where the Cloudflare API token is stored, which lowers the barrier for credential targeting. In this context, the skill is used by an agent that may process adversarial instructions, so exposing secret locations is more dangerous than in ordinary static docs.

Content

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

md
- Node.js v20+ required
- Install: `npm install -g wrangler` or use project-local `npx wrangler`
- Auth: Token stored in `~/.openclaw/secrets.json` under `cloudflare.apiToken`
- To use with curl/API calls: `TOKEN=$(jq -r '.cloudflare.apiToken' ~/.openclaw/secrets.json)`
- To use with wrangler CLI: `export CLOUDFLARE_API_TOKEN=$(jq -r '.cloudflare.apiToken' ~/.openclaw/secrets.json)`
- Verify: `wrangler whoami`

Credential Access

High
Category
Privilege Escalation
Confidence
89% confidence
Finding

The example extracts the API token from the local secrets file into a shell variable for use with API calls. This pattern can leak credentials through shell history, process inspection, logs, or accidental echoing, especially in automated or shared execution environments.

Content

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

md
- Node.js v20+ required
- Install: `npm install -g wrangler` or use project-local `npx wrangler`
- Auth: Token stored in `~/.openclaw/secrets.json` under `cloudflare.apiToken`
- To use with curl/API calls: `TOKEN=$(jq -r '.cloudflare.apiToken' ~/.openclaw/secrets.json)`
- To use with wrangler CLI: `export CLOUDFLARE_API_TOKEN=$(jq -r '.cloudflare.apiToken' ~/.openclaw/secrets.json)`
- Verify: `wrangler whoami`

Credential Access

High
Category
Privilege Escalation
Confidence
89% confidence
Finding

Exporting the token into the environment from a known local secret store is a common operational pattern, but it still expands credential exposure surface. In agentic settings, environment variables may be inherited by subprocesses or disclosed in debugging output, making this a real secret-handling weakness.

Content

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

md
- Install: `npm install -g wrangler` or use project-local `npx wrangler`
- Auth: Token stored in `~/.openclaw/secrets.json` under `cloudflare.apiToken`
- To use with curl/API calls: `TOKEN=$(jq -r '.cloudflare.apiToken' ~/.openclaw/secrets.json)`
- To use with wrangler CLI: `export CLOUDFLARE_API_TOKEN=$(jq -r '.cloudflare.apiToken' ~/.openclaw/secrets.json)`
- Verify: `wrangler whoami`

## Quick Reference

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

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

wrangler secret delete

Bulk upload from JSON file

wrangler secret bulk secrets.json

text

### KV (Key-Value Store)

Credential Access

High
Category
Privilege Escalation
Confidence
89% confidence
Finding

This Pages deployment example again instructs loading the API token from the local secrets file and exporting it into the environment. Combined with deployment actions, it creates a ready-made pattern for both credential access and immediate use against remote infrastructure, increasing blast radius if abused.

Content

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

Deploy via Wrangler CLI

bash
# IMPORTANT: wrangler pages deploy requires BOTH env vars
export CLOUDFLARE_API_TOKEN=$(jq -r '.cloudflare.apiToken' ~/.openclaw/secrets.json)
export CLOUDFLARE_ACCOUNT_ID=b4c7ead049e93e5c5d1c4f4415864c8a

npx wrangler pages deploy dist --project-name=my-project

Credential Access

High
Category
Privilege Escalation
Confidence
89% confidence
Finding

The API example extracts a bearer token from a known local secret store immediately before sending authenticated requests. This is dangerous because it teaches a direct path from local credential retrieval to remote account modification, which is particularly risky in an adversarial agent context.

Content

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

Create Pages project via API

bash
TOKEN=$(jq -r '.cloudflare.apiToken' ~/.openclaw/secrets.json)
curl -s -X POST "https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/pages/projects" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The skill documents exact credential locations and authenticated usage patterns without any warning about secret handling, redaction, or avoiding token exposure in logs and transcripts. In an agent environment, this meaningfully raises the chance that secrets are read, echoed, reused broadly, or included in command history and outputs.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill includes destructive commands such as worker deletion and rollback without explicit warnings, confirmation guidance, or environment-scoping precautions. In an agentic context, this increases the chance of accidental production-impacting actions because the skill normalizes dangerous commands as routine quick-reference operations.

Content

No source excerpt is available for this finding.

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.

KV (Key-Value Store)

bash
# Create namespace
wrangler kv namespace create <name>

# List namespaces

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The manifest description at L003 scopes the skill to Workers, KV, D1, R2, secrets, and tailing logs. However, lines L333-L413 add a substantial additional capability for Cloudflare Pages project deployment and domain management, which is a different product area not mentioned in the stated scope.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

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

Create Pages project via API

bash
TOKEN=$(jq -r '.cloudflare.apiToken' ~/.openclaw/secrets.json)
curl -s -X POST "https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/pages/projects" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name":"my-project","production_branch":"main"}'

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

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

Create Pages project via API

bash
TOKEN=$(jq -r '.cloudflare.apiToken' ~/.openclaw/secrets.json)
curl -s -X POST "https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/pages/projects" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name":"my-project","production_branch":"main"}'

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

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

Create Pages project via API

bash
TOKEN=$(jq -r '.cloudflare.apiToken' ~/.openclaw/secrets.json)
curl -s -X POST "https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/pages/projects" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name":"my-project","production_branch":"main"}'

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

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

Create Pages project via API

bash
TOKEN=$(jq -r '.cloudflare.apiToken' ~/.openclaw/secrets.json)
curl -s -X POST "https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/pages/projects" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name":"my-project","production_branch":"main"}'

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

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

Create Pages project via API

bash
TOKEN=$(jq -r '.cloudflare.apiToken' ~/.openclaw/secrets.json)
curl -s -X POST "https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/pages/projects" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name":"my-project","production_branch":"main"}'

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
83% confidence
Finding

The section at L418 states custom domains should be configured via dashboard or API, while earlier lines L355-L360 provide direct API instructions to add a custom domain to a Pages project from this same skill file. This is not merely incomplete documentation; it creates an intent-level contradiction about whether domain-related management is part of the skill's documented behavior.

Content

No source excerpt is available for this finding.