Defensive check: reject protocol-relative URLs in api_get path #25
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Type
Bug
Lineage
Discovered during QA review of PR #24 (generic api_get tool).
Repo
forgejo_admin/westside-ai-assistantWhat Broke
The
api_gettool's path validation prepends/to paths missing a leading slash, but does not reject protocol-relative URLs like//evil.com/foo. If Claude were to generate such a path, httpx could resolve it as an external request, creating an SSRF vector. Low risk given the LLM intermediary and cluster-internal network, but the defensive check is trivial.Repro Steps
BasketballClient.get("//evil.com/foo")//evil.com/fooas a protocol-relative URLBasketballClient.get("http://evil.com")could bypass the base URLExpected Behavior
Paths starting with
//or containing://should be rejected with an error before the HTTP request is made.Environment
23-generic-api-getbranch, just merged)Acceptance Criteria
//are rejected with an error://are rejected with an error/admin/playersstill workRelated
project-westside-basketball