T09 · Insecure Skill Coding Practices
- Location
SKILL.md:175- Finding
Bearer API credential can be transmitted to an attacker-controlled gateway
- Content
View full analysis
dict: """Execute a single tool via the GreenHelix REST API.""" response = requests.post( f"{GATEWAY_URL}/v1", headers=self.headers, json={"tool": tool, "input": params}, timeout=30, ) ``` ### Technical Analysis The destination receiving the `Authorization` bearer credential is controlled entirely by the `GREENHELIX_API_URL` environment variable. The example does not validate the URL scheme, hostname, port, or redirect behavior before attaching the credential. Environment variables may be modified by a compromised deployment configuration, malicious wrapper, poisoned CI/CD configuration, or another process with control over how the application is launched. An attacker could set the variable to an arbitrary HTTP or HTTPS endpoint and capture the GreenHelix API key when the client performs its next operation. The client also does not explicitly disable redirects. Although common HTTP clients generally remove authorization headers during many cross-host redirects, relying on library-specific redirect behavior is insufficient protection for a payment client. ### Attack Path 1. An attacker obtains control over the application’s environment or deployment configuration. 2. The attacker sets `GREENHELIX_API_URL` to an endpoint under their control. 3. A user initializes `GreenHelixCl ...[truncated 1203 chars]- Remediation
View remediation
