Skip to content

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.

REPRO-2026-00157 github.com/gofiber/fiber/v3 · go Info Disclosure May 23, 2026 CVE entry ↗ .txt
Severity
MEDIUM
CVSS
6.5
Reproduced in
27m 11s
Tool calls
116
Spend
$0.88
01 · Overview

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).

02 · Severity & CVSS

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 threat level
6.5 / 10 CVSS base
Weakness CWE-436

Medium — meaningful risk under specific conditions. Schedule a fix in the normal cycle.

03 · Affected Versions

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
or curl -O https://pruva.dev/api/v1/reproductions/REPRO-2026-00157/artifacts/reproduction_steps.sh && chmod +x reproduction_steps.sh && ./reproduction_steps.sh
Run in a VM or disposable container. This exploits a real vulnerability.
06 · Proof of Reproduction

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 435 events · 116 tool calls · 27 min
27 minDuration
116Tool calls
104Reasoning steps
435Events
2Dead-ends
Agent activity over 27 min
Support
20
Repro
159
Variant
252
0:0027:11

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 KeyGenerator is 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

  1. Run repro/reproduction_steps.sh.
  2. 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 the id query parameter.
    • Issues GET /?id=1 followed by GET /?id=2.
    • Captures the two response bodies to logs/vulnerable_output.txt and logs/fixed_output.txt.
  3. 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 1 then 2 (each request gets its own cache key because the query string is included).

Evidence

  • logs/vulnerable_output.txt:
    1
    1
    
  • logs/fixed_output.txt:
    1
    2
    
  • logs/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

  1. Upgrade immediately to github.com/gofiber/fiber/v3@v3.2.0 or later.
  2. If a custom KeyGenerator is in use, audit it to ensure query strings, headers, or other user-specific dimensions are incorporated into the key.
  3. 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.sh was 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 GET and HEAD requests, 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.

Event 1/40
0:001:37
0:00
session startedaccounts/fireworks/models/kimi-k2p6 · cve-2026-30246 · cve-2026
0:11
0:12
0:18
0:23
0:26
0:29
web search
1:16
1:16
extract_facts
no facts extracted
1:17
1:17
1:17
supportrepro
1:23
1:23
1:23
1:26
1:26
1:28
1:28
1:36
1:37
$git clone --depth=100 https://github.com/gofiber/fiber.git /tmp/fiber && cd /tmp/fiber && git show 050ff1ff18511c1475b8ec627460216aaecddd4e --stat
0.9s
commit 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

08 · How to Fix

How to Fix CVE-2026-30246

Upgrade github.com/gofiber/fiber/v3 · go to 3.2.0 or later.

Coming soon

Step-by-step mitigation and hardening guidance for CVE-2026-30246 — configuration checks, workarounds where no patch exists, and how to verify you're protected — is on the way.

10 · FAQ

FAQ: CVE-2026-30246

Which Fiber versions are affected by CVE-2026-30246, and where is it fixed?

github.com/gofiber/fiber/v3 versions <= 3.1.0 are affected. It is fixed in 3.2.0 — upgrade to 3.2.0 or later (or supply a KeyGenerator that includes the query string).

How can I reproduce CVE-2026-30246?

Download the verified script from this page and run it in an isolated environment against Fiber v3 <= 3.1.0 with the cache middleware and default KeyGenerator. It sends two requests to the same path with different query strings and shows the second receiving the first's cached response.
11 · References

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.