# CVE-2024-1313: Users outside an organization can delete a snapshot with its key

> An attacker can delete snapshots belonging to other organizations by exploiting a flaw in the API authorization logic.

- **Severity:** Medium 6.5 (`CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 26 Mar 2024
- **Updated:** 13 Feb 2025
- **Also known as:** BIT-grafana-2024-1313, GHSA-67rv-qpw2-6qrr, GO-2024-2697, MINI-3xxw-p477-vpwf, MINI-4w8g-v6fm-pw8g, MINI-5j65-5ph6-6w2p, MINI-65q3-v7cp-c73j, MINI-89rg-6f2m-2mv9, MINI-9rm7-7mr2-x4x7, MINI-c2jc-xj93-m52q, MINI-fm73-4cxj-wfhr, MINI-g8c8-m456-p9cm, MINI-gj3c-qp9v-j69v, MINI-gvq8-c697-896x, MINI-h7j3-x6rj-4v6x, MINI-hw3x-jwc5-2fj3, MINI-jc4c-5539-ghwx, MINI-ppcj-34wx-ghx7, MINI-rhqj-j3h7-fqxw, MINI-x964-33r5-m9mm, SUSE-SU-2024:1814-1, SUSE-SU-2024:1815-1, UBUNTU-CVE-2024-1313, openSUSE-SU-2024:13831-1

## What is CVE-2024-1313?

CVE-2024-1313 is a medium-severity missing authorization vulnerability in Grafana, published on 26 Mar 2024. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

It is possible for a user in a different organization from the owner of a snapshot to bypass authorization and delete a snapshot by issuing a DELETE request to /api/snapshots/<key> using its view key. This functionality is intended to only be available to individuals with the permission to write/edit to the snapshot in question, but due to a bug in the authorization logic, deletion requests issued by an unprivileged user in a different organization than the snapshot owner are treated as authorized.

Grafana Labs would like to thank Ravid Mazon and Jay Chen of Palo 
Alto Research for discovering and disclosing this vulnerability.

This issue affects Grafana: from 9.5.0 before 9.5.18, from 10.0.0 before 10.0.13, from 10.1.0 before 10.1.9, from 10.2.0 before 10.2.6, from 10.3.0 before 10.3.5.

Weakness: CWE-639 (Authorization Bypass Through User-Controlled Key)

## Which versions are affected by CVE-2024-1313?

12 open source packages ship an affected version, including github.com/grafana/grafana and grafana.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/grafana/grafana` | Go | All versions | None |
| `github.com/grafana/grafana` | Go | From 10.0.0 | 10.0.13 |
| `github.com/grafana/grafana` | Go | From 10.0.0 | 10.0.13 |
| `github.com/grafana/grafana` | Go | From 10.1.0 | 10.1.9 |
| `github.com/grafana/grafana` | Go | From 10.1.0 | 10.1.9 |
| `github.com/grafana/grafana` | Go | From 10.2.0 | 10.2.6 |
| `github.com/grafana/grafana` | Go | From 10.2.0 | 10.2.6 |
| `github.com/grafana/grafana` | Go | From 10.3.0 | 10.3.5 |
| `github.com/grafana/grafana` | Go | From 10.3.0 | 10.3.5 |
| `github.com/grafana/grafana` | Go | From 9.5.0 | 9.5.18 |
| `github.com/grafana/grafana` | Go | From 9.5.0 | 9.5.18 |
| `grafana` | Bitnami | From 9.5.0 | 9.5.18, 10.0.13, 10.1.9, 10.2.6, 10.3.5 |
| `grafana` | SUSE:Manager Client Tools 12-BETA | All versions | 9.5.18-4.30.4 |
| `mgr-push` | SUSE:Manager Client Tools 12-BETA | All versions | 5.0.2-4.24.5 |
| `spacecmd` | SUSE:Manager Client Tools 12-BETA | All versions | 5.0.6-41.51.3 |
| `uyuni-common-libs` | SUSE:Manager Client Tools 12-BETA | All versions | 5.0.3-3.39.3 |
| `uyuni-tools` | SUSE:Manager Client Tools 12-BETA | All versions | 0.1.9-3.11.4 |
| `grafana` | SUSE:Manager Client Tools 15-BETA | All versions | 9.5.18-159000.4.33.4 |
| `mgr-push` | SUSE:Manager Client Tools 15-BETA | All versions | 5.0.2-159000.4.24.5 |
| `spacecmd` | SUSE:Manager Client Tools 15-BETA | All versions | 5.0.6-159000.6.51.4 |
| `uyuni-common-libs` | SUSE:Manager Client Tools 15-BETA | All versions | 5.0.3-159000.3.39.3 |
| `uyuni-tools` | SUSE:Manager Client Tools 15-BETA | All versions | 0.1.9-159000.3.11.5 |
| `golang-github-prometheus-node_exporter` | SUSE:Manager Client Tools Beta for SLE Micro 5 | All versions | 1.7.0-159000.6.5.5 |
| `uyuni-tools` | SUSE:Manager Client Tools Beta for SLE Micro 5 | All versions | 0.1.9-159000.3.11.5 |
| `grafana` | openSUSE:Tumbleweed | All versions | 10.3.5-1.1 |

## How do I fix CVE-2024-1313?

Upgrade github.com/grafana/grafana to a fixed version for your release line: 10.0.13, 10.1.9, 10.2.6 or 10.3.5.

## Is CVE-2024-1313 being exploited?

There is no known exploitation of CVE-2024-1313 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-1313 and fix it if it is affected.

What it is: CVE-2024-1313 is a medium-severity missing authorization vulnerability in Grafana, published on 26 Mar 2024. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2024-1313 in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/grafana/grafana (Go): affected all versions; no fix listed
- github.com/grafana/grafana (Go): affected from 10.0.0; fixed in 10.0.13
- github.com/grafana/grafana (Go): affected from 10.0.0; fixed in 10.0.13
- github.com/grafana/grafana (Go): affected from 10.1.0; fixed in 10.1.9
- github.com/grafana/grafana (Go): affected from 10.1.0; fixed in 10.1.9
- github.com/grafana/grafana (Go): affected from 10.2.0; fixed in 10.2.6
- github.com/grafana/grafana (Go): affected from 10.2.0; fixed in 10.2.6
- github.com/grafana/grafana (Go): affected from 10.3.0; fixed in 10.3.5
- github.com/grafana/grafana (Go): affected from 10.3.0; fixed in 10.3.5
- github.com/grafana/grafana (Go): affected from 9.5.0; fixed in 9.5.18
- github.com/grafana/grafana (Go): affected from 9.5.0; fixed in 9.5.18
- grafana (Bitnami): affected from 9.5.0; fixed in 9.5.18, 10.0.13, 10.1.9, 10.2.6, 10.3.5

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2024-1313/ (Markdown: https://insights.sbomify.com/CVE-2024-1313/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2024-1313
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2024-1313
- OSV: https://osv.dev/vulnerability/CVE-2024-1313

---
From sbomify Insights: https://insights.sbomify.com/CVE-2024-1313/
Summaries are generated and may contain mistakes; the official description above is the record.
