T09 · Insecure Skill Coding Practices
- Location
references/agent-integration.md:62- Finding
Untrusted HITL Endpoints Can Receive Agent Authorization Headers
- Content
View full analysis
Vulnerability Details
File Location:
references/agent-integration.md:58-62,references/agent-integration.md:142-148, andSKILL.md:266
Vulnerability Type: Server-Side Request Forgery and credential disclosure through untrusted endpoint use
Risk Level: HighComplete Code Snippets
Polling implementation:
python while True: time.sleep(30) poll_response = httpx.get(hitl["poll_url"], headers=auth_headers)SSE implementation:
python events_url = hitl.get("events_url") if not events_url: return handle_hitl_polling(hitl, send_to_user, auth_headers) try: with httpx_sse.connect(events_url, headers=auth_headers) as sse:The root Skill also demonstrates the unsafe polling pattern:
python poll = httpx.get(hitl["poll_url"], headers=auth).json()Technical Analysis
The
poll_urlandevents_urlvalues originate in a remote service's HITL response. The examples issue requests to these URLs and attach caller-providedauth_headerswithout first establishing that the endpoint belongs to a trusted origin.Although
references/agent-integration.md:108-117validates thatreview_urluses HTTPS and has a host, equivalent validation is not applied topoll_urlorevents_url. HTTPS alone would also be insufficient because an attacker can operate an HTTPS endpoint or provide a URL resolving to an internal address.A malicious or compromised service can return an attacker-controlled endpoint and cause the agent to transmit reusable authorization headers to it. If internal and special-use destinations are reachable, the same behavior may also be used for server-side request forgery. Automatic redirects can bypass an initial validation check unless every redirect destination is independently checked.
Attack Path
- An agent sends a legitimate-looking request to a malicious or compromised service.
- The service returns HTTP 202 with a syntactic ...[truncated 1302 chars]
- Remediation
View remediation
Remediation Suggestions
- Treat every endpoint in a remote HITL object as untrusted input.
- Require HTTPS for
poll_url,events_url, andsubmit_url. - Bind these endpoints to the origin of the API that produced the HITL response, or enforce a narrowly configured allowlist of trusted origins.
- Do not forward the original request's authorization headers to an arbitrary HITL URL. Use an endpoint-specific, audience-restricted, short-lived credential.
- Parse URLs strictly and reject embedded credentials, malformed hosts, unexpected ports, and ambiguous IP representations.
- Resolve hostnames and reject loopback, private, link-local, multicast, reserved, and cloud metadata destinations. Repeat validation after DNS resolution and immediately before connection.
- Disable redirects where possible. If redirects are necessary, validate every redirect hop and never forward sensitive authorization headers across origins.
- Apply outbound network controls so the agent process cannot reach unnecessary internal or metadata networks.
- Add request timeouts, response-size limits, and an explicit set of accepted content types.
- Update the example implementation to use a validated endpoint and scoped credentials before calling
httpx.getorhttpx_sse.connect.
