CVE-2022-31097 Stored XSS in Grafana's Unified Alerting

High 7.3 Published Updated

Stored XSS in Grafana Unified Alerting allows attackers to escalate privileges from editor to admin by tricking admins into clicking malicious links.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2022-31097?

CVE-2022-31097 is a high-severity cross-site scripting vulnerability in Grafana Grafana, published on 15 Jul 2022. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.

Official description

Grafana is an open-source platform for monitoring and observability. Versions on the 8.x and 9.x branch prior to 9.0.3, 8.5.9, 8.4.10, and 8.3.10 are vulnerable to stored cross-site scripting via the Unified Alerting feature of Grafana. An attacker can exploit this vulnerability to escalate privilege from editor to admin by tricking an authenticated admin to click on a link. Versions 9.0.3, 8.5.9, 8.4.10, and 8.3.10 contain a patch. As a workaround, it is possible to disable alerting or use legacy alerting.

Weakness: CWE-79

Which versions are affected by CVE-2022-31097?

10 open source packages ship an affected version, including github.com/grafana/grafana and grafana. It affects 2 products.

PackageAffectedFixed in
github.com/grafana/grafana GoAll versionsNone
github.com/grafana/grafana GoFrom 8.0.08.3.10
github.com/grafana/grafana GoFrom 8.0.08.3.10
github.com/grafana/grafana GoFrom 8.4.08.4.10
github.com/grafana/grafana GoFrom 8.4.08.4.10
github.com/grafana/grafana GoFrom 8.5.08.5.9
4 more packages
github.com/grafana/grafana GoFrom 8.5.08.5.9
github.com/grafana/grafana GoFrom 9.0.09.0.3
github.com/grafana/grafana GoFrom 9.0.09.0.3
grafana BitnamiFrom 8.0.08.3.10, 8.4.10, 8.5.9, 9.0.3

Products include Grafana Grafana, Netapp E-Series Performance Analyzer.

How do I fix CVE-2022-31097?

Upgrade github.com/grafana/grafana to a fixed version for your release line: 8.3.10, 8.4.10, 8.5.9 or 9.0.3.

Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.

Is CVE-2022-31097 being exploited?

There is no known exploitation of CVE-2022-31097 in the wild and no public exploit code.

All Grafana Grafana vulnerabilities

Sources

Also known as BIT-grafana-2022-31097, GHSA-vw7q-p2qg-4m5f, GO-2024-2857, MINI-345r-92j2-9982, MINI-4p8r-5wpj-mm6w, MINI-6mmr-33mm-7698 and 15 more.

Is CVE-2022-31097 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free