GrafanaApplication

CVE-2022-31097

HIGH · 8.7 CVSS v3.1 Published 2022-07-15
Fix available
A fix is available. Upgrade to 8.3.10 / 8.4.10 or later.
See remediation →
91/100
Remediation priority · Urgent
High EPSS Remotely reachable

Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.

NVD · unedited
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.

Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.

dbcve analysis · high confidence

Stored cross-site scripting (XSS) vulnerability in Grafana's Unified Alerting feature allows an attacker with editor privileges to inject malicious scripts that execute when an authenticated admin views the crafted alert, enabling privilege escalation to admin level.

MitigationUpgrade Grafana to versions 9.0.3, 8.5.9, 8.4.10, or 8.3.10 or later to patch the vulnerability. Alternatively, disable alerting or migrate to legacy alerting as a workaround.

Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.

Affected products & versions What the vendor confirmedThe version ranges the vendor confirmed as vulnerable. If your version sits inside a range here, treat yourself as exposed until you have upgraded.

NVD · CPE data
GrafanaApplication
Affected:>= 8.0.0, < 8.3.10>= 8.4.0, < 8.4.10>= 8.5.0, < 8.5.9>= 9.0.0, < 9.0.3
E Series Performance AnalyzerApplication
Affected:all versions

CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.

From the vector
Attack vector
Network
Complexity
Low
Privileges
Low
User interaction
Required
Scope
Changed
Confidentiality
High
Integrity
High
Availability
None

CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N

Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.

dbcve checks

Work through these to decide whether this CVE applies to you.

  1. Check Grafana version
    Run `grafana-server -v` or inspect the Grafana UI at /api/health or check the version from the login page footer
    Affected if The installed version falls within 8.0.0 to 8.3.9, 8.4.0 to 8.4.9, 8.5.0 to 8.5.8, or 9.0.0 to 9.0.2
  2. Verify Unified Alerting is enabled
    Check the Grafana configuration file (grafana.ini) for `[unified_alerting.enabled]` set to true, or query the API endpoint GET /api/v1/ngalert
    Affected if Unified Alerting is enabled (the XSS only affects the unified alerting feature)
  3. Check for editor or viewer role users
    Inspect user list via Grafana UI (Server Admin > Users) or query GET /api/users to identify users with Editor or Viewer roles
    Affected if There are users with Editor privileges who could potentially inject malicious alert content
  4. Examine existing alert rules for suspicious content
    Query GET /api/v1/ngalert/rules or inspect alert rule configurations in the UI, looking for HTML or script tags in alert names, descriptions, or annotations
    Affected if Any alert rule contains unsanitized HTML or JavaScript in alert name, message, or annotations fields

You are affected if Grafana version is within the vulnerable range AND Unified Alerting is enabled AND an attacker with editor privileges could create or modify alert rules.

Generated from the published advisory. Verify against your own configuration.

Check your environment

Paste your version and any relevant configuration and it will be compared against the affected criteria above. Do not include secrets or credentials.

AI-assisted, checked against the advisory. Informational, not a guarantee.

Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.

dbcve · scoped
Upgrade available Upgrade to 8.3.10 / 8.4.10 / 8.5.9 or later
Fixed in 8.3.108.4.108.5.9
Interim mitigation

Upgrade Grafana to versions 9.0.3, 8.5.9, 8.4.10, or 8.3.10 or later to patch the vulnerability. Alternatively, disable alerting or migrate to legacy alerting as a workaround.

Recommended fix High confidence

Grafana 8.3.10, 8.4.10, 8.5.9, or 9.0.3 (depending on your current version branch)

  1. Identify your current Grafana version by checking the Grafana server status or configuration
  2. Determine which version branch you are on (8.3.x, 8.4.x, 8.5.x, or 9.0.x)
  3. Upgrade Grafana to the minimum fixed version for your branch: 8.3.10 if on 8.0.0-8.3.x, 8.4.10 if on 8.4.x, 8.5.9 if on 8.5.x, or 9.0.3 if on 9.0.x
  4. Follow standard Grafana upgrade procedures including backing up configuration and database
  5. After upgrade, verify the Unified Alerting feature functions correctly
  6. For E Series Performance Analyzer: no fixed version is documented; consider disabling alerting or using legacy alerting as a workaround
Caveat Upgrade follows standard Grafana patch releases; review release notes for any minor configuration changes

Generated from the published advisory — verify against the referenced sources before acting.

Fix this in Grafana Scoped from the published advisory
  • Consultation2.0 h
  • Implementation3.0 h
  • Testing3.0 h
  • Review / QA2.0 h
10.0 hours of engineering $1,750
Get the upgrade done

An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $2,800.

Scan for this in your stack

Free · runs locally
dbcve dependency scanner

Check whether your project pulls in CVE-2022-31097 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.

References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.

Primary sources

Practitioner notes

Contributed

Peer-ranked notes from engineers who’ve handled CVE-2022-31097 in production — separate from our analysis above.

No notes yet

Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.

What this is

A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.

What belongs here
  • Verified mitigations, workarounds, and config changes
  • Version or environment caveats, and links to real fixes
  • No weaponised exploit code, or anything meant to cause harm
  • No spam, self-promotion, credentials, or personal data