T05 · Unauthorized Access and Privilege Escalation
Warning
- Location
- setup.py:31
- Finding
- Excessive Strava OAuth Scopes Violate Least Privilege<![CDATA[ ## Vulnerability Details **File Location**: `setup.py`, lines 31-35 **Vulnerability Type**: Excessive OAuth permissions **Risk Level**: Medium ### Vulnerable Code ```python authorize_url = client.authorization_url( client_id=int(client_id), redirect_uri='http://localhost:8282/authorized', scope=['read', 'read_all', 'activity:read_all', 'profile:read_all'] ) ``` ### Technical Analysis The setup process requests `read`, `read_all`, `activity:read_all`, and `profile:read_all` simultaneously. These scopes grant access to private profile and activity information, while the implemented commands only display recent activities, basic athlete information, and aggregate statistics. Requesting broad private-data scopes without demonstrating that each scope is necessary violates the principle of least privilege. The exposure is amplified because the resulting access and refresh tokens are stored locally. ### Attack Path 1. The user runs `setup.py`. 2. The generated authorization request asks the user to approve all listed scopes. 3. Strava issues access and refresh tokens with the approved private-data permissions. 4. An attacker obtains the saved token through local credential-file disclosure, malware, or account compromise. 5. The attacker uses the token against the Strava API to access private profile or activity data within the granted scopes, including data beyond what the Skill normally displays. ### Impact Assessment A compromised token may permit unauthorized access to private Strava activities and profile information. The issue does not grant operating-system privileges, but it increases the volume and sensitivity of account data exposed following token compromise. ]]>
- Remediation
- <![CDATA[ ## Remediation Suggestions - Determine the minimum scopes required by each Strava API operation. - Remove private-data scopes that are not strictly necessary. - Make access to private activities or profile fields an explicit, optional setup choice. - Explain each requested scope before redirecting the user to authorization. - Consider separate authorization profiles for basic statistics and private-data access. - Add tests that verify the generated authorization URL does not silently acquire additional scopes. ]]>
