T09 · Insecure Skill Coding Practices
- Location
SKILL.md:17- Finding
Configurable API Endpoint Can Receive the Agent Token
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 17-24
Vulnerability Type: Credential disclosure through an unrestricted configurable endpoint
Risk Level: MediumVulnerable Code
markdown You can interact with the Anycast agent platform using HTTP REST calls. All requests require the `x-agent-token` header set to `$ANYCAST_API_TOKEN`. The base URL is `$ANYCAST_PORTAL_URL` (default: `https://agents.anycast.com`). ## List Online Agents ```bash curl -s -H "x-agent-token: $ANYCAST_API_TOKEN" \ "$ANYCAST_PORTAL_URL/api/agents?limit=20" | jq '.agents[] | {name, status, lastSeenAt}'text The same token-and-configurable-URL pattern is repeated by the other request examples in `SKILL.md`. ### Technical Analysis The skill directs the agent to include `ANYCAST_API_TOKEN` in the `x-agent-token` header while deriving the request destination entirely from `ANYCAST_PORTAL_URL`. Although the legitimate default is documented as `https://agents.anycast.com`, the instructions do not require HTTPS, validate the destination host, restrict redirects, or require confirmation before forwarding the credential to a custom origin. Consequently, an attacker who can influence the environment or configuration can set `ANYCAST_PORTAL_URL` to an attacker-controlled endpoint. When a documented request is invoked, `curl` sends the token to that endpoint. The attacker can then attempt to replay the captured token against the legitimate Anycast API. The actual access available depends on the token's server-side authorization scope. ### Attack Path 1. The attacker gains the ability to modify or influence `ANYCAST_PORTAL_URL`, such as through a poisoned environment, unsafe deployment configuration, or misleading setup instructions. 2. The attacker changes the variable to an endpoint under their control, potentially using plain HTTP. 3. A user or agent follows one of the documented `curl` workflows. 4. The request tra ...[truncated 1062 chars]- Remediation
View remediation
Remediation Suggestions
- Restrict the default configuration to the canonical
https://agents.anycast.comorigin. - Validate
ANYCAST_PORTAL_URLbefore every credential-bearing request:- Require HTTPS.
- Reject embedded credentials and malformed URLs.
- Compare the normalized hostname and port against an explicit allowlist.
- Resolve and reject loopback, link-local, private, and other unexpected destinations where custom public endpoints are not required.
- If self-hosted deployments must be supported, maintain an administrator-managed trusted-origin allowlist and require explicit confirmation before sending a token to a non-default origin.
- Prevent cross-origin credential forwarding during redirects. Reject redirects or verify every redirect target before resending authentication headers.
- Use narrowly scoped, short-lived, and revocable tokens so that disclosure has limited impact.
- Document clearly that changing
ANYCAST_PORTAL_URLchanges the party receivingANYCAST_API_TOKEN. - Avoid plain HTTP under all circumstances and enforce certificate verification.
- Add token rotation and revocation guidance for suspected endpoint misconfiguration or credential exposure.
- Restrict the default configuration to the canonical
