Back to skill

Security audit

CDN配置工具包免费版

Security checks for vulnerabilities and agentic risk

Overview

The skill is a CDN helper, but it includes live Cloudflare account changes and host firewall commands without enough safeguards, so users should review it before installing.

Install only if you want an agent to help with CDN configuration and diagnostics, and treat all Cloudflare API and firewall snippets as manual examples requiring explicit review. Use scoped API tokens from environment or secret storage, verify commands in staging, preserve administrative access, and prepare rollback before applying any firewall or production CDN changes.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:397
Finding

Unsafe Non-Atomic Firewall Rule Modification Can Cause Service Lockout

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 397-402
Vulnerability Type: Unsafe firewall configuration and unvalidated remote input
Risk Level: High

Vulnerable Code

bash
CF_IPS=$(curl -s https://www.cloudflare.com/ips-v4)
# ...
for ip in $CF_IPS; do
    iptables -A INPUT -p tcp -s "$ip" --dport 443 -j ACCEPT
done
iptables -A INPUT -p tcp --dport 443 -j DROP

Technical Analysis

The documented procedure retrieves a remote IP list and uses its contents directly to construct privileged firewall rules. It does not:

  • Make curl fail on HTTP or transport errors.
  • Verify that the response is nonempty and complete.
  • Validate each value as an expected IPv4 address or CIDR.
  • Apply the rules atomically through a dedicated chain or iptables-restore.
  • preserve existing administrative or service access explicitly.
  • Provide a rollback mechanism.
  • Prevent duplicate rules when run repeatedly.

The final DROP rule is unconditional. If retrieval fails or returns an incomplete response, the loop may install no ACCEPT rules—or only a partial set—before blocking all remaining inbound HTTPS traffic. Because iptables modification ordinarily requires elevated privileges, following this recipe can make system-wide networking changes.

Although the IP list is retrieved remotely, it is consumed as firewall configuration data rather than executed as code. The primary issue is therefore insecure configuration handling rather than remote payload execution.

Attack Path

  1. An operator or AI agent executes the documented recipe with sufficient privileges to modify firewall rules.
  2. The Cloudflare IP-list request fails, is truncated, or produces unexpected content.
  3. Because curl -s does not enforce successful retrieval and the response is not validated, execution continues.
  4. No valid ACCEPT rules, or only an incomplete set of rules, are appended.
  5. The unconditional port ...[truncated 870 chars]
Remediation
View remediation

Remediation Suggestions

  1. Retrieve the list with strict failure handling, such as curl --fail --show-error --silent, and abort if retrieval fails.
  2. Store the response in a controlled temporary file and verify that it is nonempty.
  3. Validate every entry against a strict IPv4 CIDR parser before constructing any firewall rule.
  4. Reject the entire update if any entry is malformed or if the number of valid ranges is unexpectedly low.
  5. Build rules in a new dedicated chain and switch traffic to that chain only after all validation and rule creation succeed.
  6. Prefer an atomic mechanism such as iptables-restore rather than incrementally appending rules.
  7. Preserve explicit management access and established connections before applying restrictive rules.
  8. Add an automatic timed rollback that is cancelled only after connectivity is verified.
  9. Check for existing rules or replace a managed chain instead of appending duplicate rules.
  10. Require explicit operator confirmation before applying host-wide firewall changes.
  11. Document tested recovery commands and advise operators to retain console or out-of-band access during deployment.

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:381
Finding

Recommended Content Security Policy Permits Unsafe Inline Script Execution

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, line 381
Vulnerability Type: Weak Content Security Policy configuration
Risk Level: Medium

Vulnerable Code

nginx
add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'" always;

Technical Analysis

The recommended security configuration includes 'unsafe-inline' in both script-src and style-src. In particular, permitting inline JavaScript substantially weakens Content Security Policy as a defense against cross-site scripting.

If an application contains a separate HTML-injection vulnerability, attacker-supplied inline script may be accepted by the browser because the policy explicitly authorizes inline script execution. The presence of a CSP header can also create a false impression that robust script-execution restrictions are in place.

This directive does not independently create an injection flaw. Exploitation requires an existing method of inserting attacker-controlled markup or script into a protected page.

Attack Path

  1. An operator deploys the documented CSP as a security-hardening measure.
  2. The protected application contains an independent reflected, stored, or DOM-based injection weakness.
  3. An attacker supplies content that reaches an inline script context or injects an inline script element or event handler.
  4. The browser evaluates the page under the documented CSP.
  5. Because script-src contains 'unsafe-inline', the CSP does not block the relevant inline execution.
  6. The script executes with the origin privileges of the affected application.

Impact Assessment

The ultimate impact depends on the underlying injection vulnerability and the privileges of the victim. Potential consequences can include reading data available to page scripts, performing same-origin actions as the victim, modifying displayed content, or compromising authenticated ...[truncated 288 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove 'unsafe-inline' from script-src.
  2. Move inline JavaScript into trusted external files where practical.
  3. For necessary inline scripts, generate a cryptographically random nonce for each response and include the matching nonce in both the CSP header and authorized script elements.
  4. Alternatively, authorize immutable inline scripts with explicit CSP hashes.
  5. Remove 'unsafe-inline' from style-src where application compatibility permits, using nonces, hashes, or external stylesheets instead.
  6. Begin migration with Content-Security-Policy-Report-Only and review violation reports before enforcing the stricter policy.
  7. Consider additional directives such as object-src 'none', base-uri 'self', frame-ancestors 'self', and a narrowly scoped connect-src.
  8. Test the final policy against all supported application flows and browsers before production rollout.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (7)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The markdown provides authenticated Cloudflare API requests that change zone security and cache settings, but it does not warn about secret handling, least-privilege tokens, or the production impact of these actions. In an agent workflow, this can normalize pasting credentials into commands and making account-level changes without adequate safeguards or confirmation.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
93% confidence
Finding

This example transmits authenticated requests to an external Cloudflare API endpoint using a bearer token, which is an external transmission of secrets and account-changing intent. While contacting a CDN API is contextually relevant, the risk arises because the skill is exec-enabled and lacks safeguards around token exposure, confirmation, and unintended live changes.

Content

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

bash
#!/bin/bash
# Cloudflare CDN基础配置脚本(使用curl API)
# ...
API_TOKEN="你的API_TOKEN"
ZONE_ID="你的ZONE_ID"

External Transmission

Medium
Category
Data Exfiltration
Confidence
90% confidence
Finding

The referenced Cloudflare API endpoint is part of a sequence of external authenticated configuration changes. In a CDN toolkit this is not inherently malicious, but without disclosure and safeguards it still represents a meaningful risk of remote account modification and possible credential exposure through logs or copied commands.

Content

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

md
ZONE_ID="你的ZONE_ID"
# ...
# 1. 开启Always Use HTTPS
curl -s -X PATCH "https://api.cloudflare.com/client/v4/zones/${ZONE_ID}/settings/always_use_https" \
    -H "Authorization: Bearer ${API_TOKEN}" \
    -H "Content-Type: application/json" \
    --data '{"value":"on"}' | jq '.success'

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill states it is not suitable for operations or deployment management, yet nearby examples instruct users to make live Cloudflare API changes and modify host firewall rules. This mismatch can mislead an agent or user about the skill’s effective authority, increasing the chance of unintended production-impacting actions.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The trigger condition says to use the skill for broad categories like code generation, programming assistance, debugging, testing, and deployment. Overly broad activation criteria can cause an agent to invoke this exec-capable skill in unrelated situations, increasing the chance of unnecessary network calls or configuration-changing actions.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The recommended firewall rules end with a blanket DROP on port 443 after allowing fetched Cloudflare IPs, without warning about lockout risk, stale IP lists, non-Cloudflare traffic requirements, or management-path preservation. This can immediately block legitimate origin traffic or administrative recovery paths, causing outage or self-denial of service.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill includes iptables commands that alter host firewall policy and can restrict origin access to only fetched Cloudflare IPs. In an agent context with exec enabled, this exceeds simple CDN guidance and can cause service lockout, loss of administrative access, or accidental denial of traffic if applied incorrectly.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.