T09 · Insecure Skill Coding Practices
- Location
scripts/strava_oauth_login.py:224- Finding
OAuth Authorization Flow Does Not Validate the State Parameter
- Content
View full analysis
")) tok = exchange_code_for_token( code=code, client_id=client_id, client_secret=client_secret ) ``` ### Technical Analysis The OAuth authorization request does not contain a cryptographically random `state` parameter. Correspondingly, neither the copy-and-paste flow nor the loopback callback verifies that an incoming authorization response belongs to the authorization transaction initiated by the script. OAuth `state` is used to bind the authorization response to the initiating client session and prevent login CSRF or authorization-response substitution. The script accepts any authorization code supplied through standard input or received as the first valid loopback callback. The token exchange still occurs against Strava's fixed HTTPS token endpoint, so this is not arbitrary credential exfiltration. The weakness instead concerns the identity and authorization transaction associated with the accepted code. ### Attack Path 1. An attacker initiates or influences a separate Strava authorization flow using the same registered client and redirect URI. 2. The attacker o ...[truncated 972 chars]- Remediation
View remediation
