Grafana Labs Strava Datasource: improper authorization
The Strava datasource plugin's resource handler POST /strava-api forwards a client-supplied endpoint string, and its query parameters, to the Strava API (https://www.strava.com/api/v3/<endpoint>) without validation.
When the datasource is not in OAuth pass-through mode, the request is made with the access token stored on the datasource, not the caller's identity. Grafana authorises plugin resource calls only on the datasources:query permission, which Viewers have by default. Any such caller could therefore request any Strava API path the connected account's OAuth grant allows, for example athlete/clubs or routes/{id}, and read the response.
The plugin's frontend (stravaApi.ts) only needs a fixed set of paths: athlete, athlete/activities, activities/{id}, activities/{id}/streams and segments/{id}.
Requests to Strava are GET only, so the issue is read-only.
Affected: plugin versions 1.2.0 through 1.7.2. The fix restricts endpoint to those five patterns and is pending release. The check runs before the access token is resolved, so a rejected request never causes a token refresh or any call to Strava. Paths with .. segments are rejected as well.
Affected versions
| Package | Affected | Fixed in |
|---|---|---|
| Strava Datasource Product | >= 1.2.0, <= 1.7.2 | No fix yet |
Details and references
- CVSS 3.1
- CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:L/I:N/A:N
- Severity from
- the vendor (its own CVE record or advisory)
- Weakness
- CWE-863