Back to skill

Security audit

Ai Web Automation Local

Security checks for vulnerabilities and agentic risk

Overview

This web automation skill is simple and not deceptive, but it can fetch any user-supplied URL from the agent's environment without network safety boundaries.

Install only if you trust the runtime environment and will use it on authorized public targets. Avoid running it where the agent can reach private networks, cloud metadata services, intranet apps, or sensitive unauthenticated endpoints unless the skill is first constrained with URL allowlists and network egress controls.

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:11
Finding

Unrestricted URL Fetching Enables Server-Side Request Forgery

Content
View full analysis

Vulnerability Details

File Location: main.py, lines 11–15 and 48–52
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)

The untrusted URL reaches the vulnerable function through the command-line interface:

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

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

Technical Analysis

The application accepts a user-controlled URL and passes it directly to requests.get() without validating the scheme, hostname, resolved IP address, port, or redirect destination.

This creates an SSRF condition because the request originates from the environment running the skill and therefore uses that environment's network reachability. An attacker can target loopback addresses, RFC1918 private networks, link-local services, or cloud metadata endpoints. Moreover, requests.get() follows redirects by default, so validating only the initial URL would not be sufficient.

Although the complete response body is not written to the report, the application exposes response-derived information, including the HTTP status code, content length, page title, and number of matched links. These values can act as an oracle for internal service discovery and limited data extraction.

Attack Path

  1. An attacker invokes the skill with the scrape action and supplies an internal or otherwise protected URL.
  2. main() assigns the untrusted argument to url without validation.
  3. scrape_web() passes the URL directly to requests.get().
  4. The process connects to the destination using its own network privileges.
  5. The application processes the response and writes its status, length, title, and link count to a Markdown report.
  6. The attacker reads the generated report or console-provided report path to infer whether the internal service exists and ...[truncated 1097 chars]
Remediation
View remediation

Remediation Suggestions

  1. Restrict accepted schemes to http and https; reject credentials, malformed hosts, and unsupported URL forms.
  2. Prefer an explicit allowlist of approved domains and ports when the intended use permits it.
  3. Resolve the hostname before connecting and reject every resolved address belonging to loopback, private, link-local, multicast, unspecified, reserved, or other non-public ranges for both IPv4 and IPv6.
  4. Explicitly block cloud metadata destinations and environment-specific internal service names.
  5. Disable automatic redirects unless required. If redirects are enabled, validate every redirect target using the same scheme, hostname, port, DNS, and IP checks.
  6. Protect against DNS rebinding by ensuring the validated address is the address used for the connection, or enforce destination restrictions through a controlled outbound proxy.
  7. Apply network-level egress filtering so the process cannot connect to internal networks or metadata services.
  8. Allow only approved destination ports and set strict connection and read timeouts.
  9. Stream responses and enforce a maximum response size to prevent resource exhaustion.
  10. Return a clear validation error without exposing unnecessary internal connection details.
  11. Add tests covering loopback, RFC1918, link-local, IPv6 local addresses, alternate IP encodings, malicious 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
92% confidence
Finding

The skill advertises web scraping, automated form submission, scheduled execution, proxy support, and notification integration, all of which can affect third-party systems and involve collection or transmission of potentially sensitive data. Without any safety guidance, authorization requirements, rate-limiting expectations, privacy notices, or misuse boundaries, users may deploy it in ways that violate privacy, terms of service, or cause unintended automated interactions with external services.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

SQP-3 applies to all file types and includes language or locale policy violations. This file presents the skill description and usage in Chinese only, with no indication that other languages are supported or that the locale restriction is intentional and justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The docstring at L13 is written only in Chinese while the rest of the CLI interface is in English, creating a mixed-language experience with no user choice or documented locale constraint. This is a natural-language locale policy issue because the skill does not offer an opt-in or explain that it is intended for a Chinese-only audience.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The package description includes both English and Chinese text, but the file does not explain whether the skill is intended for multilingual use or whether a specific language is required. Under the language/locale policy, forcing or assuming a language without documented user choice or justification can be a policy concern.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.