Back to skill

Security audit

AI Web Automation

Security checks for vulnerabilities and agentic risk

Overview

The skill is a simple web-scraping tool, but it can fetch arbitrary user-supplied URLs without destination limits, which could expose local or internal network services if misused.

Install only if you are comfortable with the skill making outbound web requests from your agent environment. Use it only for authorized targets, avoid internal/private/metadata URLs, and review or add URL allowlisting, redirect validation, rate limits, and confirmation for any future scheduled, proxy, or submission features.

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 (1)

T09 · Insecure Skill Coding Practices

Error
Location
main.py:12
Finding

Unrestricted User-Controlled URL Fetching Enables Server-Side Request Forgery

Content
View full analysis

Vulnerability Details

File Location: main.py, lines 12–16; the URL enters from command-line input at lines 49–53
Vulnerability Type: Server-Side Request Forgery (SSRF)
Risk Level: High

Vulnerable Code:

python
def scrape_web(url):
    """抓取网页"""
    try:
        import requests
        response = requests.get(url, timeout=10)

User-Controlled Input Flow:

python
action = sys.argv[1]
url = sys.argv[2]

if action == "scrape":
    result = scrape_web(url)

Technical Analysis

The application accepts an arbitrary URL from sys.argv[2] and passes it directly to requests.get. It does not validate the URL scheme, hostname, resolved IP address, destination port, or redirect targets.

An attacker who can invoke the skill can therefore cause the runtime host to send requests to destinations that may not be directly accessible to the attacker, including:

  • Loopback services such as 127.0.0.1 or ::1
  • Private network services
  • Link-local addresses and cloud instance metadata endpoints
  • Internal administrative interfaces
  • Attacker-controlled URLs that redirect to restricted destinations

Because requests.get follows redirects by default, validating only the initial hostname would not be sufficient. DNS resolution must also be checked to prevent hostnames from resolving to prohibited address ranges.

The implementation does not return the complete response body. However, it writes response-derived information to a report, including the status code, content length, HTML title, and number of links. This permits internal-service discovery and limited information disclosure.

Attack Path

  1. The attacker invokes the skill with the scrape action and supplies a loopback, private-network, link-local, metadata, or redirecting URL.
  2. main() reads the attacker-controlled value from sys.argv[2].
  3. main() passes that value to scrape_web() without valida ...[truncated 1122 chars]
Remediation
View remediation

Remediation Suggestions

  1. Permit only explicitly required schemes, normally https and, if necessary, http.
  2. Prefer an explicit allowlist of trusted hostnames rather than accepting arbitrary Internet destinations.
  3. Resolve the hostname before connecting and reject every resolved loopback, private, link-local, multicast, unspecified, and reserved IPv4 or IPv6 address.
  4. Block known cloud metadata destinations and other environment-specific sensitive endpoints.
  5. Disable automatic redirects with allow_redirects=False, or validate the scheme, hostname, port, and resolved IP address at every redirect hop.
  6. Prevent DNS rebinding by ensuring the validated address is the address used for the connection.
  7. Restrict destination ports to those required for the feature.
  8. Apply outbound firewall or proxy rules so application-level validation is not the only protection.
  9. Stream responses with strict connection, read, and total-size limits to reduce resource-exhaustion risk.
  10. Return generic errors and avoid exposing internal destination details to untrusted callers.
  11. Add automated tests covering loopback, private IPv4 and IPv6 ranges, link-local addresses, metadata endpoints, encoded IP representations, redirects, and DNS rebinding scenarios.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (4)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill advertises web scraping, scheduled execution, automated submissions, proxy pool support, and notification integrations without any documented guardrails around consent, rate limiting, robots/ToS compliance, credential handling, or privacy-sensitive data collection. In a web automation context, these capabilities can readily be used for abusive scraping, spammy form submission, or covert monitoring at scale, and the lack of warnings or constraints increases the chance of unsafe or policy-violating use.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

The natural-language content of the skill is presented in Chinese, and the file does not indicate that this language choice is optional or region-specific. This can violate language/locale policy when a skill forces a specific language without user opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The docstring on L13 is written only in Chinese ("抓取网页"), indicating a fixed language choice in the skill's user-facing or developer-facing natural language without any opt-in or explanation. The policy requires avoiding forced language or locale constraints unless the skill offers choice or clearly documents a justified regional scope.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

The package description includes Chinese text alongside English, indicating a specific language/locale expectation without documenting user choice or regional justification. Under the policy, language constraints or defaults should be optional or clearly justified rather than implicitly imposed.

Content

No source excerpt is available for this finding.