T09 · Insecure Skill Coding Practices
- Location
SKILL.md:154- Finding
Agent credentials may be transmitted to an untrusted destination over plaintext HTTP
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:154-182andskill.json:16-20
Vulnerability Type: Plaintext sensitive-data transmission and insufficient destination validation
Risk Level: HighThe example client stores the Agent identifier and secret in request headers, accepts an unrestricted caller-controlled
base_url, and sends those headers without validating the URL scheme or destination. The documented default uses plaintext HTTP.Vulnerable Code
SKILL.md:154-182:python def __init__(self, base_url, agent_id, secret_key): self.base_url = base_url self.headers = { "X-Agent-ID": agent_id, "X-Agent-Secret": secret_key, "Content-Type": "application/json" } def register(self, name, skill_id, endpoint_url, game_types): """Register Agent""" url = f"{self.base_url}/api/v1/agents/register" data = {"name": name, "skill_id": skill_id, "endpoint_url": endpoint_url, "game_types": game_types} resp = requests.post(url, json=data) result = resp.json() if resp.status_code == 200: return result["agent_id"], result["secret_key"] raise Exception(f"Registration failed: {result}") def get_game_state(self, game_id): """Retrieve game state""" url = f"{self.base_url}/api/v1/games/{game_id}/state" resp = requests.get(url, headers=self.headers) return resp.json() def submit_move(self, game_id, move, agent_id): """Submit move""" url = f"{self.base_url}/api/v1/games/{game_id}/moves" data = {"move": move, "agent_id": agent_id} resp = requests.post(url, json=data, headers=self.headers) return resp.json()skill.json:16-20:json "base_url": { "type": "string", "default": "http://localhost:8080", "description": "Game platform base URL" }The remaining authenticated methods in
SKILL.md:199-207use the same unrestricted base URL and sensitive ...[truncated 3085 chars]- Remediation
View remediation
Remediation Suggestions
- Require
https://for every non-loopback destination. Permit plaintext HTTP only for explicitly validated loopback development addresses such as127.0.0.1,::1, or an approved local socket. - Change the production-facing default to an HTTPS endpoint, or omit the default and require explicit trusted configuration.
- Parse
base_urlwith a standard URL parser and reject unsupported schemes, embedded user information, malformed hosts, unexpected ports, and ambiguous host representations. - Restrict authenticated requests to an allowlisted platform origin. Validate the normalized scheme, host, and port immediately before attaching credentials.
- Disable automatic redirects for authenticated requests or manually follow redirects only after confirming that the destination has the same trusted origin. Never forward
X-Agent-Secretacross origins. - Use a configured
requests.Sessionwith strict TLS certificate verification and explicit connection/read timeouts. - Keep the secret in a dedicated secret store or protected environment variable rather than prompts, logs, or source files. Avoid printing request headers and redact secrets from exceptions and diagnostics.
- Document credential rotation and revocation procedures. Rotate any credential suspected of having traversed plaintext HTTP or an untrusted endpoint.
- Where supported by the platform, replace a long-lived static secret with short-lived, narrowly scoped tokens restricted to the minimum game operations required.
- Require
