Back to skill

Security audit

legal-page-discovery

Security checks for vulnerabilities and agentic risk

Overview

This skill is a coherent legal-page discovery tool, but its URL discovery workflow can let a target website steer the agent into fetching unintended internal or third-party network locations.

Install only if you are comfortable with the agent making live web requests. Prefer running it in a network-restricted environment or updating the skill to keep all discovered URLs and redirects on the approved domain, block private and loopback addresses, and ask before contacting any other origin. Choose an explicit output directory to avoid overwriting existing manifest files.

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
SKILL.md:49
Finding

Unrestricted fetching of attacker-supplied discovery URLs enables SSRF

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 49–62, 113, and 131
Vulnerability Type: Server-Side Request Forgery through untrusted sitemap, robots.txt, and redirect targets
Risk Level: Medium

Vulnerable Instructions

markdown
Fetch `https://<domain>/sitemap.xml`. If it is a sitemap *index* (contains `<sitemap>` entries
pointing at other sitemap files), fetch each referenced sitemap and union their URL lists. Also
try `https://<domain>/sitemap_index.xml` if the first returns nothing.
markdown
Fetch `https://<domain>/robots.txt`. Note:
- Any `Sitemap:` directives not already tried in 1a — fetch those too.
- Any `Disallow:` paths containing the signal words above. A disallowed path is not crawled by
  search engines, but it is not access-controlled — fetch it directly in Step 2 like any other
  candidate.
markdown
Union the URLs from 1a–1d, deduplicated by normalized URL (strip trailing slashes, fragments, and
tracking query parameters).
bash
curl -sL -A "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36" "<URL>" -o /tmp/page.html

Technical Analysis

The Skill instructs the Agent to fetch sitemap locations supplied by a website, add discovered URLs to a candidate set, and retrieve every candidate with curl -L. It does not require discovered URLs to remain on the user-authorized origin, restrict URL schemes, reject loopback/private/link-local/reserved addresses, or validate redirect destinations.

The base website is external and potentially attacker-controlled. Its sitemap index, Sitemap: directives, page links, or HTTP redirects can therefore cause the Agent to issue requests to a different trust zone. The -L option compounds this issue by automatically following redirects without validating each hop.

This crosses the authorization boundary be ...[truncated 1614 chars]

Remediation
View remediation

Remediation Suggestions

  1. Restrict all retrievals to http and https.
  2. Require sitemap references, discovered links, and candidate pages to remain on the user-authorized origin by default.
  3. Require explicit user approval before contacting a different origin.
  4. Resolve hostnames before every request and reject loopback, private, link-local, multicast, unspecified, and reserved address ranges for both IPv4 and IPv6.
  5. Disable automatic redirects or validate the scheme, hostname, resolved address, and origin of every redirect hop before following it.
  6. Re-resolve and revalidate destinations at connection time to mitigate DNS rebinding and time-of-check/time-of-use issues.
  7. Apply the same validation to sitemap indexes, Sitemap: directives, page links, and path-derived candidates.
  8. Prevent responses from rejected or non-authorized origins from being read, classified, or copied into output manifests.
  9. Prefer a constrained retrieval helper that enforces these policies instead of issuing unrestricted curl -L commands.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • 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 (1)

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

This markdown skill description states that it will write legal-page-manifest.md and .json files, but it does not include a clear cautionary warning that the skill modifies the local filesystem. Because the behavior affects user data/workspace state, the description should more explicitly disclose that files will be created or overwritten at the chosen location.

Content

No source excerpt is available for this finding.