CVE-2026-42554 Fiber: XSS in AutoFormat Content Negotiation
Remote attackers can inject arbitrary HTML/JavaScript via the Accept header when developers use the AutoFormat feature in the Go Fiber web framework.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is CVE-2026-42554?
CVE-2026-42554 is a medium-severity cross-site scripting vulnerability in gofiber fiber, published on 11 May 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Official description
Fiber is a web framework for Go. Prior to 2.52.12 and 3.1.0, Cross-Site Scripting vulnerability in Go Fiber allows a remote attacker to inject arbitrary HTML/JavaScript by supplying Accept: text/html on any request whose handler passes attacker-influenced data to the AutoFormat() feature. The developer opts into content negotiation by calling AutoFormat(), but does not opt into raw HTML emission for a particular request; Fiber chooses that branch from attacker-controlled Accept. The html branch is the sole outlier in a method whose name (AutoFormat) and symmetrical structure actively telegraph "safe, format-agnostic reply." This vulnerability is fixed in 2.52.12 and 3.1.0.
Weakness: CWE-79
Which versions are affected by CVE-2026-42554?
6 open source packages ship an affected version, including github.com/gofiber/fiber/v2 and github.com/gofiber/fiber/v3. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
github.com/gofiber/fiber/v2 Go | All versions | 2.52.13 |
github.com/gofiber/fiber/v2 Go | All versions | 2.52.13 |
github.com/gofiber/fiber/v2 Go | All versions | 2.52.13 |
github.com/gofiber/fiber/v3 Go | All versions | 3.2.0 |
github.com/gofiber/fiber/v3 Go | All versions | 3.2.0 |
github.com/gofiber/fiber/v3 Go | All versions | 3.2.0 |
Products include Gofiber Fiber.
How do I fix CVE-2026-42554?
Upgrade github.com/gofiber/fiber/v2 to 2.52.13 or later.
Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.
Is CVE-2026-42554 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-42554 exists.
Other vulnerabilities in gofiber fiber
- CVE-2024-38513 Fiber Session Middleware Token Injection Vulnerability
- CVE-2023-45128 CSRF Token Reuse Vulnerability in fiber
- CVE-2024-25124 Fiber has Insecure CORS Configuration, Allowing Wildcard Origin with Credentials
- CVE-2025-66630 Fiber insecurely fallsback in utils.UUIDv4() / utils.UUID() — predictable / zero‑UUID on crypto/rand failure
- CVE-2025-54801 Fiber Susceptible to Crash via `BodyParser` Due to Unvalidated Large Slice Index in Decoder
Sources
Also known as GHSA-qjv7-627w-8qjv, GO-2026-5585.