T09 · Insecure Skill Coding Practices
- Location
scripts/cf-global.sh:7- Finding
Global API Key Exposed Through Process Command-Line Arguments
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This Cloudflare helper is coherent and not deceptive, but it gives an agent broad live Cloudflare control using a Global API Key without strong guardrails.
Use this only if you intentionally need legacy Global API Key automation for Cloudflare. Prefer a scoped API-token-based workflow when possible, run it only on trusted systems, verify zone and record IDs before mutations, and add your own confirmation process before delete, import, SSL, cache purge, or tunnel operations.
scripts/cf-global.sh:7Global API Key Exposed Through Process Command-Line Arguments
scripts/cf-global.sh:4All Operations Require an Overprivileged Account-Wide Global API Key
Referenced artifact was not completely inspected
Use `scripts/cf-global.sh` for repeatable Cloudflare operations.
Referenced artifact was not completely inspected
Use `scripts/cf-global.sh` for repeatable Cloudflare operations.
The dns-delete operation permanently deletes DNS records immediately with no confirmation, dry-run mode, or safeguard. In an agent setting, a mistaken or malicious invocation could cause domain outage, traffic hijacking recovery delays, or service disruption by removing critical records.
Changing SSL mode or purging cache can immediately affect site availability, origin connectivity, and user-facing behavior, yet the script executes these actions without warning or confirmation. In production environments, accidental SSL downgrades or full cache purges can create outages, expose insecure configurations, or cause severe performance regressions.
The skill advertises shell-backed operational capability but does not declare any explicit tool scope or permission boundary. That increases the chance an agent can invoke shell actions with broader-than-expected authority, especially for live Cloudflare administration tasks that can modify DNS, SSL, cache, and tunnels.
The description includes destructive and high-impact operations such as delete, import, SSL changes, cache purge, and tunnel deletion without any prominent warning or confirmation requirement. In a production DNS/control-plane context, accidental or coerced execution could cause outages, traffic interception, or service disruption.
The script requires and directly uses a Cloudflare Global API Key and email to authenticate requests, but provides no user-facing warning that a highly privileged long-lived credential will be consumed and transmitted to an external service. In agent contexts, lack of disclosure increases the risk of users unknowingly granting broad account access, especially because Global API Keys are significantly more dangerous than scoped API tokens.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
: "${CLOUDFLARE_GLOBAL_API_KEY:?Set CLOUDFLARE_GLOBAL_API_KEY}"
: "${CLOUDFLARE_EMAIL:?Set CLOUDFLARE_EMAIL}"
CF_API="https://api.cloudflare.com/client/v4"
AUTH=(-H "X-Auth-Email: ${CLOUDFLARE_EMAIL}" -H "X-Auth-Key: ${CLOUDFLARE_GLOBAL_API_KEY}" -H "Content-Type: application/json")
cf_request() {
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
cf_request() {
local method="$1" path="$2" data="${3:-}"
if [[ -n "$data" ]]; then
curl -fsS -X "$method" "${AUTH[@]}" -d "$data" "$CF_API$path"
else
curl -fsS -X "$method" "${AUTH[@]}" "$CF_API$path"
fi
Bulk DNS import and settings modification perform write operations that can materially alter production infrastructure without any warning, preview, or approval boundary. This makes accidental mass misconfiguration easier and increases the blast radius of prompt mistakes or misuse in an automated agent workflow.
The skill instructs use of highly sensitive environment credentials, including a legacy Global API Key with broad account power, but does not include strong handling guidance or warnings about least privilege and exposure. If logs, subprocess output, prompts, or misconfigured environments leak these values, an attacker could gain extensive control over Cloudflare-managed assets.
The manifest describes DNS, zone settings, SSL, cache purge, page rules, firewall rules, and tunnels, but it does not mention analytics access. The code adds an analytics command that queries zone analytics totals, which extends behavior beyond the stated description.