Miggo Logo

CVE-2022-21673: Grafana Forward OAuth Identity Token can allow users to access some data sources

2.2

CVSS Score
3.1

Basic Information

EPSS Score
0.59535%
Published
5/14/2024
Updated
5/14/2024
KEV Status
No
Technology
TechnologyGo

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:L/I:N/A:N
Package NameEcosystemVulnerable VersionsFirst Patched Version
github.com/grafana/grafanago> 7.2.0, < 7.5.137.5.13
github.com/grafana/grafanago>= 8.0.0, < 8.3.48.3.4

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from improper context handling in datasource_proxy.go operations. Key functions in pkg/api/datasource_proxy.go are responsible for forwarding authentication headers. The system incorrectly used cached OAuth tokens from previous user sessions when processing API token-authenticated requests, rather than validating() the current user context. This matches the vulnerability's core mechanism where API token usage could access stale OAuth credentials. The high confidence comes from the architectural role of these functions in authentication forwarding and the patch versions specifically addressing proxy handling in release notes.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

W**n * **t* sour** **s t** *orw*r* O*ut* I**ntity ***tur* *n**l**, s*n*in* * qu*ry to t**t **t*sour** wit* *n *PI tok*n (*n* no ot**r us*r *r***nti*ls) will *orw*r* t** O*ut* I**ntity o* t** most r***ntly lo****-in us*r. T*is **n *llow *PI tok*n *ol

Reasoning

T** vuln*r**ility st*ms *rom improp*r *ont*xt **n*lin* in `**t*sour**_proxy.*o` op*r*tions. K*y *un*tions in `pk*/*pi/**t*sour**_proxy.*o` *r* r*sponsi*l* *or *orw*r*in* *ut**nti**tion *****rs. T** syst*m in*orr**tly us** ****** O*ut* tok*ns *rom pr*