T09 · Insecure Skill Coding Practices
- Location
scripts/wiki-ingest.md:8- Finding
Unrestricted URL Retrieval Permits Server-Side Request Forgery
- Content
View full analysis
Vulnerability Details
File Location:
scripts/wiki-ingest.md:8-12; the same behavior is also specified intemplates/WIKI-SCHEMA.md:78-80and enabled by the URL-capable queue format intemplates/queue-template.md:4
Vulnerability Type: Server-Side Request Forgery through unrestricted source retrieval
Risk Level: HighVulnerable Code:
markdown 2. Read `work/wiki-sources/ingestion-queue.md` for pending items. 3. If the queue is empty, reply `NO_REPLY`. 4. For each pending source (max 3 per run): a. Read the source from `work/wiki-sources/` (or fetch URL if web source). b. Extract: key claims, facts, entities, relationships, dates. c. Check `memory/wiki/index.md` to see if an existing page covers the topic.The schema repeats the unsafe retrieval requirement:
markdown 1. Check `work/wiki-sources/ingestion-queue.md` for pending items 2. Read each source from `work/wiki-sources/` (or fetch URL) 3. Extract key claims, facts, entities, relationshipsTechnical Analysis
The ingestion workflow accepts arbitrary URLs from a writable Markdown queue and instructs an agent to fetch them. It does not impose an HTTPS-only policy, trusted-host allowlist, URL normalization, redirect limit, DNS/IP validation, response-size limit, or restrictions against loopback, link-local, private-network, and cloud metadata addresses.
Consequently, an attacker who can add or influence a queue entry may cause the ingestion agent to issue requests from the OpenClaw host or its network context. URLs such as loopback services, RFC1918 addresses, IPv6 local addresses, or cloud metadata endpoints could be reached if the agent's web-fetching tool permits them. Redirects and DNS rebinding could potentially bypass validation performed only on the original URL.
This behavior is not necessary at its current privilege level. Remote-source ingestion is part of the declared functionality, but unrestricted acc ...[truncated 1663 chars]
- Remediation
View remediation
Remediation Suggestions
- Require explicit user approval before fetching each remote source, especially during scheduled or unattended ingestion.
- Permit only
https://URLs and reject URLs containing embedded credentials, nonstandard schemes, malformed hostnames, or ambiguous numeric IP representations. - Resolve the hostname before connecting and reject loopback, link-local, multicast, unspecified, private, reserved, and cloud metadata address ranges for both IPv4 and IPv6.
- Repeat destination validation after every redirect and DNS resolution. Apply a small redirect limit and prevent redirects from public hosts to private destinations.
- Prefer an allowlist of approved public domains where operationally practical.
- Route retrieval through a sandboxed fetcher with no access to the local network, host credentials, cookies, or authenticated browser sessions.
- Enforce response-size, content-type, and timeout limits.
- Keep remotely fetched content out of cloud synchronization until a user reviews and approves the generated wiki changes.
- Log the normalized URL, resolved address, redirects, and final destination for security review without logging credentials or sensitive response bodies.
