CVE-2026-30246: Verified Repro With Script Download
CVE-2026-30246: Fiber v3: cache middleware key collision leaks responses across different query strings
CVE-2026-30246 is verified against github.com/gofiber/fiber/v3 · go. Affected versions: <= 3.1.0. Fixed in 3.2.0. Vulnerability class: Info Disclosure. This medium reproduction includes runnable sandbox proof, artifacts, and a plain-text agent view under REPRO-2026-00157.
What Is CVE-2026-30246?
CVE-2026-30246 is a medium-severity cache key collision in the cache middleware of Fiber v3 (github.com/gofiber/fiber/v3). Responses can leak across requests with different query strings. Pruva reproduced it (reproduction REPRO-2026-00157).
CVE-2026-30246 Severity & CVSS Score
CVE-2026-30246 is rated medium severity, with a CVSS base score of 6.5 out of 10.
Medium — meaningful risk under specific conditions. Schedule a fix in the normal cycle.
Affected github.com/gofiber/fiber/v3 Versions
github.com/gofiber/fiber/v3 · go versions <= 3.1.0 are affected.
How to Reproduce CVE-2026-30246
pruva-verify REPRO-2026-00157 curl -O https://pruva.dev/api/v1/reproductions/REPRO-2026-00157/artifacts/reproduction_steps.sh && chmod +x reproduction_steps.sh && ./reproduction_steps.sh Proof of Reproduction for CVE-2026-30246
Reproduced by Pruva's autonomous agents — 116 tool calls over 27 min. Full root-cause analysis and the complete transcript are below.
How the agent worked
Root Cause and Exploit Chain for CVE-2026-30246
Summary
In github.com/gofiber/fiber/v3 versions <= 3.1.0, the default KeyGenerator of the cache middleware returns only c.Path(), ignoring the query string and all other request dimensions. This causes cache key collisions for requests to the same path with different query parameters (e.g., /?id=1 vs /?id=2). The second request receives the first request's cached response, leading to cross-user information disclosure and cache confusion (CWE-200 / CWE-524).
Impact
- Package:
github.com/gofiber/fiber/v3(Go module) - Affected versions:
<= 3.1.0 - Fixed version:
3.2.0 - Severity: Medium (CVSS 3.1 base 6.5)
- Consequences: Any application using the default cache middleware without a custom
KeyGeneratoris vulnerable to cache confusion. Responses tailored to one user's query parameters may be leaked to another user requesting the same path with different parameters.
Root Cause
The vulnerable code in middleware/cache/config.go at v3.1.0 defines the default KeyGenerator as:
KeyGenerator: func(c fiber.Ctx) string {
return utils.CopyString(c.Path())
},
In middleware/cache/cache.go, the cache lookup key is built as:
baseKey := cfg.KeyGenerator(c) + "_" + requestMethod
Because c.Path() returns only the URL path without the query string, requests to /?id=1 and /?id=2 both resolve to the same cache key (/_GET). The second request therefore hits the cached entry from the first request and receives the wrong response body.
The fix in v3.2.0 (commits 9a0d12c07ed895b84c72987f9288b04137afe5de and 050ff1ff18511c1475b8ec627460216aaec627460216aaecddd4e) completely rewrites the default key generator (defaultKeyGenerator) to include:
- HTTP method
- Escaped path (preventing delimiter injection)
- Canonical query string (sorted, with bounds to prevent DoS)
- Selected representation headers (
Accept,Accept-Encoding,Accept-Language) - Optional cookie dimensions
This ensures requests with different query parameters produce distinct cache keys, eliminating the collision.
Reproduction Steps
- Run
repro/reproduction_steps.sh. - The script creates a scratch Go module, installs Fiber v3.1.0 (vulnerable) and v3.2.0 (fixed) separately, and for each version:
- Builds a small Fiber server with the default
cache.New()middleware. - Registers a handler on
/that returns theidquery parameter. - Issues
GET /?id=1followed byGET /?id=2. - Captures the two response bodies to
logs/vulnerable_output.txtandlogs/fixed_output.txt.
- Builds a small Fiber server with the default
- Expected evidence:
- Vulnerable (v3.1.0): both responses are
1(the second request hits the cache entry from the first because the query string is ignored in the key). - Fixed (v3.2.0): responses are
1then2(each request gets its own cache key because the query string is included).
- Vulnerable (v3.1.0): both responses are
Evidence
logs/vulnerable_output.txt:1 1logs/fixed_output.txt:1 2logs/summary.txt: contains the full run output with confirmation messages.repro/runtime_manifest.json: structured evidence with request/response pairs and verdict.
Recommendations / Next Steps
- Upgrade immediately to
github.com/gofiber/fiber/v3@v3.2.0or later. - If a custom
KeyGeneratoris in use, audit it to ensure query strings, headers, or other user-specific dimensions are incorporated into the key. - Regression test: add an integration test that issues two requests to the same path with different query parameters and asserts distinct response bodies when caching is enabled.
Additional Notes
- Idempotency:
repro/reproduction_steps.shwas executed twice consecutively with identical results, confirming idempotency. - Edge cases: The vulnerability is present regardless of the number or names of query parameters, as long as the path component remains identical. The default cache middleware only caches
GETandHEADrequests, so other HTTP methods are not affected by this specific key collision.
CVE-2026-30246 Reproduction Transcript
The agent's step-by-step process — every tool call, every handoff, the moment the exploit fired.
Full session Replay every step — scrub the timeline or play it back.
git clone --depth=100 https://github.com/gofiber/fiber.git /tmp/fiber && cd /tmp/fiber && git show 050ff1ff18511c1475b8ec627460216aaecddd4e --statcommit 050ff1ff18511c1475b8ec627460216aaecddd4e
Author: René <rene@gofiber.io>
Date: Thu Apr 23 16:38:07 2026 +0200
refactor: improve cache key generation by escaping key delimiters and normalizing method names
middleware/cache/cache.go | 12 ++++++------
middleware/cache/cache_test.go | 2 +-Artifacts and Evidence for CVE-2026-30246
Scripts, logs, diffs, and output captured during the reproduction.
No artifacts available
How to Fix CVE-2026-30246
Upgrade github.com/gofiber/fiber/v3 · go to 3.2.0 or later.
FAQ: CVE-2026-30246
Which Fiber versions are affected by CVE-2026-30246, and where is it fixed?
How can I reproduce CVE-2026-30246?
References for CVE-2026-30246
Authoritative sources for CVE-2026-30246 — official vulnerability databases and the upstream advisory. Pruva's reproduction verifies the issue firsthand; these are the primary records to corroborate it.