T09 · Insecure Skill Coding Practices
- Location
SKILL.md:147- Finding
Unrestricted API Endpoint Override Can Exfiltrate Bearer Credentials
- Content
View full analysis
dict: """Call a GreenHelix REST endpoint for the given tool.""" response = session.post(f"{API_BASE}/v1/tools/{tool}", json=input_data) response.raise_for_status() return response.json() ``` ### Technical Analysis The destination of every authenticated request is controlled by the `GREENHELIX_API_URL` environment variable. The same reusable session automatically includes `GREENHELIX_API_KEY` as a bearer credential. The code does not validate the URL scheme or hostname, enforce an allowlist, reject embedded credentials or local network addresses, restrict redirects, or specify a timeout. Consequently, anyone able to modify the process environment can redirect both the API credential and sensitive migration payloads to an arbitrary server. Because the key is described as granting read/write access to purchased API tools, this network behavior can exceed minimum privilege when the same broadly scoped token is used for identity, financial, webhook, and key-management operations. ### Attack Path 1. An attacker compromises a CI/CD variable, deployment environment, shell profile, or orchestration configuration. 2. The attacker sets `GREENHELIX_API_URL` to an attacker-controlled URL. 3. An operator runs one of the guide's examples with a real `GREENHELIX_API_KEY`. 4. The session sends the bearer credential and agent migration data to the malicious endpoint. 5. The malicious server records the credential and ...[truncated 569 chars]- Remediation
View remediation
