CVE-2022-31097
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 · uneditedGrafana 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 confidenceStored 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.
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>= 8.0.0, < 8.3.10>= 8.4.0, < 8.4.10>= 8.5.0, < 8.5.9>= 9.0.0, < 9.0.3all versionsCVSS 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 checksWork through these to decide whether this CVE applies to you.
-
Check Grafana versionRun `grafana-server -v` or inspect the Grafana UI at /api/health or check the version from the login page footerAffected 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
-
Verify Unified Alerting is enabledCheck the Grafana configuration file (grafana.ini) for `[unified_alerting.enabled]` set to true, or query the API endpoint GET /api/v1/ngalertAffected if Unified Alerting is enabled (the XSS only affects the unified alerting feature)
-
Check for editor or viewer role usersInspect user list via Grafana UI (Server Admin > Users) or query GET /api/users to identify users with Editor or Viewer rolesAffected if There are users with Editor privileges who could potentially inject malicious alert content
-
Examine existing alert rules for suspicious contentQuery GET /api/v1/ngalert/rules or inspect alert rule configurations in the UI, looking for HTML or script tags in alert names, descriptions, or annotationsAffected 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.
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 · scoped8.3.108.4.108.5.9
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.
Grafana 8.3.10, 8.4.10, 8.5.9, or 9.0.3 (depending on your current version branch)
- Identify your current Grafana version by checking the Grafana server status or configuration
- Determine which version branch you are on (8.3.x, 8.4.x, 8.5.x, or 9.0.x)
- 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
- Follow standard Grafana upgrade procedures including backing up configuration and database
- After upgrade, verify the Unified Alerting feature functions correctly
- For E Series Performance Analyzer: no fixed version is documented; consider disabling alerting or using legacy alerting as a workaround
Generated from the published advisory — verify against the referenced sources before acting.
- Consultation2.0 h
- Implementation3.0 h
- Testing3.0 h
- Review / QA2.0 h
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 locallyCheck 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 sourcesPractitioner notes
ContributedPeer-ranked notes from engineers who’ve handled CVE-2022-31097 in production — separate from our analysis above.
The advisory tells you what broke. It rarely tells you what actually worked. If you’ve dealt with this one, that detail is what the next engineer is searching for.
- The version that genuinely resolved it — not the one the vendor claimed
- A config change or rule that shut the vector down
- A gotcha in the upgrade path that cost you an afternoon
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.
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.
- 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