T09 · Insecure Skill Coding Practices
- Location
SKILL.md:284- Finding
OAuth Credentials Can Be Transmitted to an Unrestricted Token Endpoint
- Content
View full analysis
str: """Get OAuth2 access token.""" async with httpx.AsyncClient() as client: resp = await client.post( token_url, data={ "grant_type": "client_credentials", "client_id": client_id, "client_secret": client_secret, }, ) resp.raise_for_status() return resp.json()["access_token"] ``` ### Technical Analysis The generated OAuth helper accepts `token_url` without validating its scheme or destination before transmitting `client_id` and `client_secret`. It does not require HTTPS, compare the endpoint against an expected provider origin, or explicitly prevent cross-origin redirects. Network transmission of OAuth credentials is necessary for the Skill's declared API-integration functionality. However, allowing an arbitrary destination exceeds minimum privilege because credentials should only be sent to an explicitly trusted authorization server. If an OpenAPI specification, API document, configuration value, or caller supplies a malicious URL, the generated client may disclose credentials to an attacker-controlled endpoint. ### Attack Path 1. An attacker supplies or modifies an API specification, documentation source, or configuration containing an attacker-controlled token endpoint. 2. The Skill generates an integration that passes this endpoint as `token_url`. 3. The user configures valid OAuth client credentials and runs the generated integration. 4. The helper sends the client identifier and secret to the attacker-controlled server. 5. The attacker uses the exposed credentials to request tokens or access resources permitte ...[truncated 468 chars]- Remediation
View remediation
