Join the Cyber Forum: Threat Intel on May 12, 2026 to learn how AI is reshaping threat defense.Join the Virtual Cyber Forum: Threat IntelRegister Now
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2022-21702

CVE-2022-21702: Grafana Cross-Site Scripting Vulnerability

CVE-2022-21702 is a cross-site scripting vulnerability in Grafana that allows attackers to execute malicious scripts through datasource or plugin proxies. This article covers the technical details, attack vectors, and mitigations.

Published: February 11, 2026

CVE-2022-21702 Overview

CVE-2022-21702 is a Cross-Site Scripting (XSS) vulnerability affecting Grafana, the widely-deployed open-source platform for monitoring and observability. This vulnerability allows an attacker to serve malicious HTML content through the Grafana datasource or plugin proxy mechanisms, potentially executing arbitrary JavaScript in the context of an authenticated user's browser session.

The attack requires social engineering to convince users to click specially crafted links that point to attacker-controlled resources configured within Grafana. This can be achieved by either compromising an existing datasource for a specific Grafana instance or by instructing users to configure malicious public services as datasources or plugins.

Critical Impact

Authenticated users who click malicious links may have their sessions compromised, potentially allowing attackers to perform actions on their behalf within Grafana, including accessing sensitive monitoring data and modifying dashboard configurations.

Affected Products

  • Grafana Grafana (versions prior to 7.5.15 and 8.3.5)
  • NetApp E-Series Performance Analyzer
  • Fedora 34, 35, and 36

Discovery Timeline

  • February 8, 2022 - CVE-2022-21702 published to NVD
  • November 21, 2024 - Last updated in NVD database

Technical Details for CVE-2022-21702

Vulnerability Analysis

This XSS vulnerability exists in Grafana's proxy mechanisms that forward requests to configured datasources and plugins. The core issue stems from insufficient sanitization of HTTP response headers when proxying content from external sources. When Grafana proxies responses from datasources or plugins configured with "Server" access mode, it fails to properly set security headers that would prevent the browser from interpreting the proxied content as HTML.

The vulnerability can be exploited through three distinct attack vectors:

  1. Datasource Proxy: When an HTTP-based datasource is configured with Server access mode, an attacker controlling the datasource URL can serve malicious HTML content.

  2. Plugin Proxy: Similar to the datasource proxy, HTTP-based app plugins with configured URLs can be exploited if the attacker controls the backend server.

  3. Backend Plugin Resource: Compromised plugins can serve malicious content directly through backend plugin resource endpoints.

Root Cause

The root cause of CVE-2022-21702 lies in the absence of proper response header sanitization in Grafana's reverse proxy implementation. The proxy code failed to set appropriate Content-Security-Policy, X-Content-Type-Options, and related headers on proxied responses, allowing browsers to render potentially malicious HTML content served through the proxy endpoints.

Attack Vector

The attack is network-based and requires user interaction. An attacker must:

  1. Control an HTTP server that Grafana is configured to proxy to (either by compromising an existing datasource or by convincing an administrator to add a malicious one)
  2. Craft a URL pointing to the attacker-controlled datasource/plugin through Grafana's proxy
  3. Trick an authenticated Grafana user into clicking the malicious link

When the victim clicks the link, the malicious HTML/JavaScript served by the attacker's server executes in the context of Grafana's origin, giving the attacker access to the user's session and any actions they can perform.

go
// Security patch in pkg/api/pluginproxy/ds_proxy.go
// Source: https://github.com/grafana/grafana/commit/27726868b3d7c613844b55cd209ca93645c99b85

 	return nil, err
 }
 res.Header.Del("Set-Cookie")
+proxyutil.SetProxyResponseHeaders(res.Header)
 return res, nil
}

The patch adds a call to SetProxyResponseHeaders which sets appropriate security headers on proxied responses to prevent XSS attacks.

go
// Security patch in pkg/api/pluginproxy/pluginproxy.go
// Source: https://github.com/grafana/grafana/commit/27726868b3d7c613844b55cd209ca93645c99b85

 	}
 }

-return &httputil.ReverseProxy{Director: director}
+return &httputil.ReverseProxy{Director: director, ModifyResponse: modifyResponse}
+}
+
+func modifyResponse(resp *http.Response) error {
+	proxyutil.SetProxyResponseHeaders(resp.Header)
+
+	return nil
}

This patch adds a ModifyResponse function to the reverse proxy that ensures all proxied responses have proper security headers applied before being returned to the client.

Detection Methods for CVE-2022-21702

Indicators of Compromise

  • Unusual HTTP requests to Grafana proxy endpoints (/api/datasources/proxy/* or /api/plugin-proxy/*) with HTML content types in responses
  • Access logs showing authenticated users accessing datasource proxy URLs with suspicious or unfamiliar external datasource configurations
  • Browser console errors or CSP violations in Grafana user sessions indicating attempted script injection

Detection Strategies

  • Monitor Grafana access logs for requests to proxy endpoints that return Content-Type: text/html responses
  • Implement network monitoring to detect outbound connections from Grafana servers to unexpected or newly-configured external endpoints
  • Review Grafana datasource and plugin configurations for unauthorized or suspicious additions
  • Deploy web application firewalls (WAF) with rules to detect XSS payloads in proxied responses

Monitoring Recommendations

  • Enable verbose logging on Grafana servers and forward logs to a SIEM for correlation and analysis
  • Set up alerts for new datasource or plugin configurations, especially those with Server access mode
  • Monitor for unusual user activity patterns that might indicate session compromise, such as bulk data exports or permission changes
  • Implement Content Security Policy reporting to detect attempted XSS exploitation

How to Mitigate CVE-2022-21702

Immediate Actions Required

  • Upgrade Grafana to version 7.5.15 or 8.3.5 or later immediately
  • Audit all configured datasources and plugins to identify any potentially malicious or compromised external endpoints
  • Review Grafana access logs for any evidence of exploitation attempts
  • Educate users about the risks of clicking untrusted links, even if they appear to point to internal Grafana instances

Patch Information

Grafana has released patched versions that address this vulnerability by implementing proper security header handling in the proxy code. The fix is available in:

  • Grafana 7.5.15 for the 7.x branch
  • Grafana 8.3.5 for the 8.x branch

The security patch (commit 27726868b3d7c613844b55cd209ca93645c99b85) adds the SetProxyResponseHeaders function call to both the datasource proxy and plugin proxy code paths, ensuring that appropriate security headers are set on all proxied responses.

For detailed information, refer to the GitHub Security Advisory GHSA-xc3p-28hw-q24g and the Grafana Blog Release Announcement.

Workarounds

  • There are no known workarounds for this vulnerability; upgrading to patched versions is the only recommended remediation
  • As a defense-in-depth measure, restrict which users can configure datasources and plugins to trusted administrators only
  • Consider implementing network-level restrictions to limit which external hosts Grafana can proxy to
  • Enable strict Content Security Policy headers at the web server level if possible, though this may interfere with Grafana functionality
bash
# Configuration example
# Verify your Grafana version
grafana-cli --version

# Upgrade Grafana on Debian/Ubuntu
sudo apt-get update
sudo apt-get install grafana

# Upgrade Grafana on RHEL/CentOS
sudo yum update grafana

# Restart Grafana service after upgrade
sudo systemctl restart grafana-server

# Verify the new version is running
grafana-cli --version

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeXSS

  • Vendor/TechGrafana

  • SeverityMEDIUM

  • CVSS Score5.4

  • EPSS Probability1.25%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityLow
  • AvailabilityNone
  • CWE References
  • CWE-79
  • Technical References
  • Fedora Package Announcement

  • Fedora Package Announcement

  • Fedora Package Announcement

  • NetApp Security Advisory NTAP-20220303-0005
  • Vendor Resources
  • GitHub Commit 27726868

  • GitHub Security Advisory GHSA-xc3p-28hw-q24g

  • Grafana Blog Release Announcement
  • Related CVEs
  • CVE-2026-32117: Grafana Cubism Panel XSS Vulnerability

  • CVE-2025-41117: Grafana Explore Traces XSS Vulnerability

  • CVE-2025-4123: Grafana XSS Vulnerability via Redirect

  • CVE-2025-6023: Grafana OSS Open Redirect XSS Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English