Grafana CVE-2025-6023 Bypass — A Technical Deep Dive #1724
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🤖 Automated Content Update
This PR was automatically generated by the HackTricks News Bot based on a technical blog post.
📝 Source Information
🎯 Content Summary
Title/Context
This post (dated 2025-11-27) details a bypass chain that circumvents Grafana’s fix for CVE-2025-6023 (an open redirect that can be escalated into XSS and account takeover). The bypass was originally discovered by @msanft and used as a challenge in Hack.lu CTF 2025. The author validated exposure across customers on 2025-10-20 (24 days before the patch). At the time of writing, no new CVE had been issued...
🔧 Technical Details
Trick 1 — Fragment smuggling to bypass redirect validation (Go url.Parse):
If a backend validates redirects by parsing user input with
url.Parse()and only checkingURL.Path(e.g., regex +path.Clean()) but ignoresURL.Fragment, an attacker can hide the malicious redirect target after#. The parsed path appears safe (/), so validation passes. If the application later constructs the HTTP redirect using the original unsanitized string, the resultingLocationheader can still encode an external redirect (open redirect), which can be chained into XSS/account takeover.Trick 2 — Client-side path traversal via “validate decoded/cleaned, return original” bug:
If a frontend path sanitizer decodes and cleans a path (including splitting on
?) and performs traversal checks on the cleaned value, but then returns the original encoded input, an attacker...🤖 Agent Actions
Summary:
url.Parse+ raw redirects, and frontend decode/clean/return-original traversal) culminating in XSS/account takeover via external script loading.Tests:
This PR was automatically created by the HackTricks Feed Bot. Please review the changes carefully before merging.