Back to skill

Security audit

GEO 运营助手

Security checks for vulnerabilities and agentic risk

Overview

This GEO assistant is mostly purpose-aligned, but its optional webpage fetcher can retrieve arbitrary URLs without safety limits, which makes it risky in agent environments.

Install only if you trust users not to feed it sensitive or internal URLs, or run it in an environment where outbound access to private networks and metadata services is blocked. Prefer pasted webpage text over the fetch script, and redact confidential prompts, answers, client data, and screenshots in generated reports.

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
scripts/fetch_webpage.py:31
Finding

Unrestricted URL Fetching Enables Server-Side Request Forgery

Content
View full analysis

Vulnerability Details

File Location: scripts/fetch_webpage.py:31-44
Vulnerability Type: Server-Side Request Forgery (SSRF)
Risk Level: High

Vulnerable Code

python
def fetch_webpage(url: str, timeout: int = 30) -> dict:
    """
    Fetch webpage content and extract structured information.

    Args:
        url: Target webpage URL
        timeout: Request timeout in seconds

    Returns:
        A dictionary containing structured webpage information
    """
    try:
        # Send HTTP request
        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=timeout)
        response.raise_for_status()

The URL is supplied directly through the command-line interface and passed to the vulnerable function without validation:

python
parser.add_argument('--url', required=True, help='Target webpage URL')
parser.add_argument('--timeout', type=int, default=30, help='Request timeout in seconds')
parser.add_argument('--output', choices=['json', 'text'], default='json',
                    help='Output format')

args = parser.parse_args()

result = fetch_webpage(args.url, args.timeout)

Technical Analysis

The fetcher accepts an arbitrary user-controlled URL and passes it directly to requests.get. It does not validate:

  • The URL scheme
  • The destination hostname
  • The resolved IPv4 or IPv6 address
  • The destination port
  • Whether the address belongs to a loopback, private, link-local, reserved, or unspecified range
  • Redirect destinations

Because requests.get follows redirects by default, validation of only the initial URL would not be sufficient. A public URL could redirect the request to an internal service.

The script subsequently parses and exposes the response body through its structured result:

`` ...[truncated 2539 chars]

Remediation
View remediation

Remediation Suggestions

  1. Restrict URL schemes

    • Parse the URL before use.
    • Permit only http and https.
    • Reject URLs containing embedded credentials.
    • Reject malformed or ambiguous host representations.
  2. Block non-public destinations

    • Resolve all destination hostnames before connecting.
    • Reject every resolved IPv4 and IPv6 address classified as loopback, private, link-local, multicast, reserved, or unspecified.
    • Explicitly block cloud metadata destinations, including 169.254.169.254 and relevant metadata hostnames.
    • Revalidate immediately before the connection to reduce DNS-rebinding risk.
  3. Validate every redirect

    • Prefer disabling automatic redirects with allow_redirects=False.
    • If redirects are required, impose a small redirect limit and repeat complete scheme, hostname, port, and resolved-address validation for every redirect target.
  4. Restrict ports and destinations

    • Permit only the ports necessary for public webpage retrieval, normally 80 and 443.
    • Where practical, use a domain allowlist or a controlled outbound proxy that enforces public-network-only access.
  5. Limit response resources

    • Use streaming requests.
    • Enforce a strict maximum response size before buffering or parsing.
    • Apply connection and read timeouts separately.
    • Reject unsupported content types before parsing.
    • Limit the amount of extracted text, links, headings, and image metadata.
  6. Harden the execution environment

    • Apply outbound firewall rules that prevent access to private networks and metadata services.
    • Run the fetcher with minimal privileges and no unnecessary cloud identity.
    • Avoid exposing raw internal error details to untrusted callers.
  7. Add security tests

    • Test loopback, RFC1918, link-local, IPv4-mapped IPv6, encoded IP, DNS-rebinding, and redirect-to-private-address cases.
    • Verify that oversized responses and redirect loops are safely rejected.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (14)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

声明描述的是一个面向GEO运营决策的分析/建议型助手,重点应在优化策略、引用表现分析、权威性评估和发布建议。代码却仅是一个通用网页抓取器,负责访问指定URL并抽取页面结构化内容。虽然抓取网页内容可以作为某些分析任务的辅助步骤,但当前代码没有任何与GEO优化、关键词扩展、引用分析、权威性评估或发布策略相关的逻辑,因此其主要用途与声明明显不一致。此外,代码包含主动网络访问能力,而声明中未体现这种具体能力。故应判定为描述与行为不匹配。

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding

The skill references local files under references/assets and explicitly allows optional webpage fetching via scripts, which implies file-read and network-reachable behavior without any declared tool scope or permission boundaries. In an agent environment, missing explicit permissions increases the risk of over-broad tool use, unexpected remote access, or retrieval of unintended local content.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger condition includes broad phrases like generic optimization requests and product/keyword optimization, which can cause the skill to activate outside its intended GEO niche. Over-triggering is dangerous because it may steer unrelated conversations into workflows that request URLs, analyze external content, or invoke optional network-enabled steps without the user's clear GEO-specific intent.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The template explicitly asks operators to attach screenshots or detailed records of complete AI answers, but it provides no guidance to minimize, redact, or avoid storing sensitive content. Full model outputs can contain personal data, confidential business details, copyrighted text, or regulated information from test prompts, creating unnecessary data retention and secondary disclosure risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The appendix directs retention of detailed verification records including time, model, question, answer, and citation status, which can create a durable log of prompts and outputs without any privacy notice or handling controls. In a GEO operations workflow, those prompts and answers may include proprietary strategy, customer data, or sensitive test content, increasing exposure through internal access, sharing, or future reuse.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This markdown file presents all instructions, examples, and usage guidance exclusively in Chinese. Under the language/locale policy rule, forcing a specific language without user opt-in is a natural-language policy concern unless the locale restriction is explicitly justified, which is not stated here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

This markdown file contains natural-language instructions and examples exclusively in Chinese, with no indication that users may choose another language. Under the policy, forcing a specific language without user opt-in is a language/locale policy concern unless the locale restriction is explicitly documented and justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This Python file contains natural-language docstrings, CLI help text, and output text entirely in Chinese, which imposes a specific language on users. The file does not offer a language/locale option or document that the tool is intentionally restricted to a Chinese-language context.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The file's natural-language descriptions and CLI help/output strings are written only in Chinese, with no option for the user to choose another language. This creates a language policy issue because the skill imposes a locale-specific experience without documented opt-in or justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The manifest description is presented only in Chinese, and the rest of the skill instructions are likewise Chinese-only. This can amount to a language policy issue when the skill implicitly forces a specific language without stating that users may choose another language.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

This template library presents all instructions, headings, and examples exclusively in Chinese, and does not indicate that the language is optional or region-specific. Under the policy criteria, forcing a specific language without user opt-in can be a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

This markdown file contains user-facing instructional content exclusively in Chinese, starting from the title and continuing throughout the document. Under the policy rule, forcing a specific language without user opt-in can be a natural-language policy violation when no language choice or justification is provided.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

This markdown file presents all guidance exclusively in Chinese and does not indicate that users may choose another language. Under the language/locale policy rule, forcing a specific language without opt-in can be a natural-language policy violation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

This code performs a network request to an arbitrary URL, which can disclose the target URL and the client's network access to a remote server. Although the module docstring describes the functionality, there is no explicit user-facing warning, confirmation, or runtime notice about the outbound HTTP request and data retrieval behavior.

Content

No source excerpt is available for this finding.