Back to skill

Security audit

智能摘要

Security checks for vulnerabilities and agentic risk

Overview

This is a straightforward summarization skill, but its unrestricted URL fetching should be reviewed before use in network-sensitive environments.

Install only in environments where arbitrary outbound HTTP(S) requests are acceptable. Avoid using --url on untrusted prompts or links when the runtime can reach internal services, and avoid summarizing confidential local files unless you trust the execution environment and its logs/output handling.

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

Warning
Location
summarize.py:67
Finding
Unrestricted URL Fetching Enables Server-Side Request Forgery<![CDATA[ ## Vulnerability Details **File Location**: `summarize.py`, lines 67–75; user-controlled input and invocation occur at lines 129 and 159 **Vulnerability Type**: Server-Side Request Forgery (SSRF) **Risk Level**: Medium ### Vulnerable Code ```python def get_url_content(url): """抓取网页正文内容""" try: headers = { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36' } response = requests.get(url, headers=headers, timeout=30) response.encoding = response.apparent_encoding soup = BeautifulSoup(response.text, 'html.parser') ``` The URL originates from the command-line argument and is passed directly to the vulnerable function: ```python group.add_argument('--url', help="网页URL地址") ``` ```python elif args.url: text = get_url_content(args.url) source = args.url ``` ### Technical Analysis The application passes a user-controlled URL directly to `requests.get()` without validating the URL scheme, hostname, resolved IP address, destination port, or network range. Consequently, the process can be instructed to send HTTP requests to destinations that may be reachable from the host but unavailable to an external 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 - Services exposed on nonstandard ports The `requests` library follows redirects by default. Therefore, validating only the initial hostname would remain insufficient: an apparently public URL could redirect the request to an internal destination. DNS rebinding or hostnames resolving to prohibited addresses could similarly bypass hostname-only checks. The returned response body is parsed as HTML and incorporated into generated summaries and keywords. This provides a limited response-disclosure channel rather than a blind ...[truncated 1506 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Parse the URL before making a request and allow only explicitly supported schemes, preferably `https` and, only where necessary, `http`. 2. Reject URLs containing credentials, malformed hosts, unsupported ports, or ambiguous address representations. 3. Resolve the hostname and reject every resolved IPv4 or IPv6 address belonging to loopback, private, link-local, multicast, reserved, unspecified, or other prohibited ranges. 4. Disable automatic redirects with `allow_redirects=False`, or validate every redirect target using the same scheme, hostname, port, and resolved-address controls. 5. Defend against DNS rebinding by ensuring the validated address is the address actually used for the connection. Prefer a hardened outbound proxy or network egress policy where possible. 6. Consider an explicit domain allowlist if the expected use cases involve a limited set of trusted sources. 7. Apply network-level controls preventing the process from reaching cloud metadata endpoints, internal administrative networks, and sensitive local services. 8. Limit accepted response sizes and content types to reduce resource-exhaustion risk and avoid processing unexpected binary content. 9. Call `response.raise_for_status()` and handle failures without incorporating error pages or unintended service responses into output. 10. Add tests covering direct private addresses, IPv6 loopback, encoded IP forms, public-to-private redirects, and hostnames resolving to prohibited ranges. ]]>
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (4)

Lp3

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding
The skill advertises capabilities to read local files and fetch remote webpages, but it does not declare any explicit tool scope such as permissions or allowed-tools. This creates an authorization ambiguity where an agent or runtime may grant broader-than-necessary access, increasing the risk of unintended file access or network retrieval in a context that can process sensitive data.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The skill encourages summarizing local documents and fetched webpages but does not warn users that the processed content may contain private, regulated, or otherwise sensitive information. This can lead to accidental exposure of confidential data to the summarization pipeline, logs, downstream models, or remote fetch components without informed user consent.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
This code hard-codes a specific output encoding and presents descriptions/messages in Chinese, which constitutes a language/locale constraint with no user opt-in or documented justification. The policy allows locale constraints only when user choice is offered or the constraint is clearly justified.

Natural-Language Policy Violations

Low
Confidence
85% confidence
Finding
The manifest and user-facing instructions are written entirely in Chinese, while the capability list says the skill supports both Chinese and English. There is no explicit language choice or opt-in mechanism, so the default presentation may impose a specific language/locale on users.

Static analysis

No suspicious patterns detected.