T09 · Insecure Skill Coding Practices
- Location
references/detail.md:18- Finding
Unrestricted RSS URL Fetching Enables Server-Side Request Forgery
- Content
View full analysis
Vulnerability Details
File Location:
references/detail.md:18-27; additional occurrences inreferences/detail.md:129-130andSKILL.md:254-258
Vulnerability Type: Server-Side Request Forgery through an unrestricted user-supplied URL
Risk Level: HighVulnerable Code
python def fetch(self, url, timeout=10): """获取RSS源""" try: response = requests.get(url, timeout=timeout, headers=self.headers) if response.status_code == 200: return response.content return None except Exception as e: print(f"获取失败:{e}") return NoneThe alternative examples contain the same behavior:
python r = requests.get(url, timeout=10, headers={'User-Agent': 'Mozilla/5.0'}) root = ET.fromstring(r.content)Technical Analysis
The Skill legitimately needs outbound network access to retrieve RSS feeds. However, it passes the supplied URL directly to
requests.getwithout validating:- The URL scheme
- The destination hostname or resolved IP address
- Loopback, private, link-local, reserved, and cloud metadata address ranges
- Embedded URL credentials
- Redirect destinations
- DNS changes between validation and connection
- Response size or expected content type
Consequently, the network capability exceeds the minimum privilege needed to access ordinary public RSS feeds. An attacker can provide a URL targeting services accessible from the Agent host but inaccessible from the attacker's own network.
requestsfollows redirects by default, so validating only an initial URL in a future partial fix would remain insufficient. Every redirect destination must also be checked.The audit did not find evidence that the Skill intentionally sends local credentials or files to an external server. The flagged network behavior is primarily an unrestricted retrieval issue rather than confirmed sensitive-data exfiltration.
Attack Path
- An attacker asks the Agent to convert an attacker-selected R ...[truncated 1462 chars]
- Remediation
View remediation
Remediation Suggestions
- Accept only
httpsURLs unless HTTP support is explicitly required. - Parse the URL before making a request and reject malformed URLs, embedded credentials, unsupported ports, and non-HTTP schemes.
- Resolve the hostname and reject every address in loopback, private, link-local, multicast, unspecified, reserved, and documentation ranges for both IPv4 and IPv6.
- Explicitly block infrastructure metadata destinations, including link-local metadata addresses.
- Disable automatic redirects or manually follow a small number of redirects while repeating the complete destination validation for every hop.
- Protect against DNS rebinding by ensuring that the address used for the connection is the validated address.
- Prefer an explicit allowlist of trusted RSS domains when the deployment permits it.
- Limit response size while streaming rather than loading an unbounded response into memory.
- Require an RSS or XML-compatible content type and reject unexpected response formats.
- Apply strict connection and read timeouts, not only a single general timeout.
- Run the fetcher in a network sandbox that cannot access localhost, private networks, or metadata services.
- Avoid returning raw internal response data or detailed network errors to untrusted users.
- Accept only
