CVE-2021-39226 Discovered on endpoint https://██████/api/snapshots
The Grafana snapshot endpoints allowed unauthenticated and authenticated users to view and, in some configurations, delete snapshots by using the lowest database key. An attacker could walk through all snapshot data and cause complete snapshot data loss.
Originally disclosed on HackerOne
- Triaged in 2 hours
- Fixed in 2 months
- Disclosed after 3 months
Description: CVE-2021-39226 Discovered on endpoint https://███████/api/snapshots/:key where this issue poses a significant risk to the confidentiality and integrity of snapshot data, allowing both authenticated and unauthenticated users unauthorized access and deletion capabilities.
References
https://nvd.nist.gov/vuln/detail/CVE-2021-39226
Impact
"In affected versions unauthenticated and authenticated users are able to view the snapshot with the lowest database key by accessing the literal paths: /dashboard/snapshot/:key, or /api/snapshots/:key. If the snapshot "public_mode" configuration setting is set to true (vs default of false), unauthenticated users are able to delete the snapshot with the lowest database key by accessing the literal path: /api/snapshots-delete/:deleteKey. Regardless of the snapshot "public_mode" setting, authenticated users are able to delete the snapshot with the lowest database key by accessing the literal paths: /api/snapshots/:key, or /api/snapshots-delete/:deleteKey. The combination of deletion and viewing enables a complete walk through all snapshot data while resulting in complete snapshot data loss.".
Source: https://nvd.nist.gov/vuln/detail/CVE-2021-39226
System Host(s)
██████
Affected Product(s) and Version(s)
Grafana
CVE Numbers
CVE-2021-39226
Steps to Reproduce
Visit the endpoint 'https://████/api/snapshots' and use '/:key' and to delete visit 'https://█████/api/snapshots-delete' and use '/:deleteKey' to delete and view all snapshot data.
Suggested Mitigation/Remediation Actions
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the snapshot endpoints used a predictable lowest database key and did not enforce proper authorisation checks for viewing and deletion.
Impact
Unauthenticated and authenticated users could view snapshots, and could delete them when public mode was enabled or when authenticated, leading to complete snapshot data loss.
What the attacker needed
None for viewing; public_mode true for unauthenticated deletion; an account for authenticated deletion
How it was found
- Visit the snapshots API endpoint.
- Use the key path segment to view the snapshot with the lowest database key.
- Visit the snapshot delete endpoint.
- Use the delete key path segment to delete the snapshot with the lowest database key.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A snapshot is a saved copy of a dashboard. The report says the web addresses that serve snapshots did not properly check who was asking, so anyone could read them and, in some setups, delete them. That means private dashboard data could leak and saved copies could be wiped.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.