← Back to Pull requests

ACM-44186: CVE-2026-76154: Sanitize Geomap attribution to prevent stored XSS #689

Open
unknown opened this pull request with 217 lines diff across 2 files
View on GitHub
unknown unknown commented on Nov 04, 2026 13:01 UTC
Author

CVE-2026-76154: Sanitize Geomap attribution to prevent stored XSS

Summary

Cherry-picks the Geomap panel XSS fix from upstream commit 05757e789657299d00314f8f96d49d1aca569f33 to release-2.17.

Vulnerability

The Geomap panel's MapLibre style base layer loads a map style from a URL and inserts the style's attribution field into the page without sanitizing it. A user with the Editor role can host a malicious style configuration that executes arbitrary JavaScript in the browser of anyone who views the dashboard — enabling escalation to Org Admin.

  • CVE: CVE-2026-76154

  • CVSS: 7.3 (Important)

  • CWE: CWE-79 (Stored Cross-Site Scripting)

  • Affected: Grafana 12.3.0–12.4.10 (release-2.17 uses 12.4.0)

  • Tracker: ACM-44186
  • Fix

    Adds an HTML sanitization layer for map attribution text using textUtil.sanitize() from the grafana/data package:

    1. NEW public/app/plugins/panel/geomap/utils/attribution.ts — guardLayerAttribution() recursively wraps all layer sources' setAttributions() to sanitize attribution before DOM insertion
    2. NEW public/app/plugins/panel/geomap/utils/attribution.test.ts — Tests covering onerror handlers, script payloads, iframes, legitimate attributions, nested LayerGroups, and dynamic sources
    3. MODIFIED public/app/plugins/panel/geomap/utils/layers.ts — Imports and calls guardLayerAttribution(layer) after handler.init()

    Only the 3 geomap-specific files from the upstream commit are included. Unrelated changes (CHANGELOG, go.mod/sum, OAuth connectors, plugin storage) are excluded.

    ---
    AI-generated. Review for accuracy.

    @kofibreik requested from Slack

    Diff: 217 lines (+162 / -55) across 2 files Reviewer: coleenquadros Review duration: 37599m
    All Vouch review confidence checks passed
    Residual risk 0.20 = Change Risk (0.37) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.37 · 217 lines diff across 2 files
    0.37
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.322
    Real PR Conversation Timeline
    1 comments
    "Review active on #689"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 36.7% (MEDIUM) · Higher = larger blast radius
    36.7%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 46.7% · Lower = rushed or shallow review
    46.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 19.6% · Safe to merge
    19.6%