Time-of-check Time-of-use (TOCTOU) Race Condition Affecting github.com/grafana/grafana/pkg/api package, versions <12.4.0


Severity

Recommended
0.0
low
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.16% (6th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-GOLANG-GITHUBCOMGRAFANAGRAFANAPKGAPI-15367345
  • published2 Mar 2026
  • disclosed25 Feb 2026
  • creditse1en

Introduced: 25 Feb 2026

CVE-2026-21725  (opens in a new tab)
CWE-367  (opens in a new tab)

How to fix?

Upgrade github.com/grafana/grafana/pkg/api to version 12.4.0 or higher.

Overview

github.com/grafana/grafana/pkg/api is an open and composable observability and data visualization platform.

Affected versions of this package are vulnerable to Time-of-check Time-of-use (TOCTOU) Race Condition through a time-of-check-to-time-of-use condition in the datasource deletion process. An attacker can cause unauthorized deletion of a newly recreated datasource by exploiting a race condition after deletion and before permission checks are updated.

Note: This is only exploitable if the attacker previously had admin access to the datasource, deletes it, the datasource is recreated within 30 seconds on the same pod with the same UID but without the attacker as admin, and all actions occur within this short window.

CVSS Base Scores

version 4.0
version 3.1