T09 · Insecure Skill Coding Practices
- Location
SKILL.md:133- Finding
Bearer Credential Exposure Through an Unrestricted API Destination
- Content
View full analysis
dict: """Execute a tool on the GreenHelix gateway.""" resp = self.session.post( f"{self.base_url}/v1", json={"tool": tool, "input": input_data}, ) resp.raise_for_status() return resp.json() ``` ### Technical Analysis The API client accepts a caller-controlled `base_url` while attaching the bearer credential to a persistent `requests.Session`. Every request made through that session includes the `Authorization` header, regardless of whether the destination is an approved GreenHelix endpoint. There is no validation requiring HTTPS, no exact-host allowlist, no restriction on redirects, and no separation between destination selection and credential attachment. If untrusted configuration, environment data, or upstream caller input can influence `base_url`, the bearer token can be sent directly to an attacker-controlled server. The default path is also internally inconsistent: `base_url` already ends in `/v1`, while `_execute()` appends another `/v1`. This produces `/v1/v1` and may encourage users to override the destination during troubleshooting, increasing the likelihood of unsafe configuration. Although authenticated network access is necessary f ...[truncated 1495 chars]- Remediation
View remediation
