CVE-2026-42554 Fiber: XSS in AutoFormat Content Negotiation

Medium 5.3 Published Updated

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.

PackageAffectedFixed in
github.com/gofiber/fiber/v2 GoAll versions2.52.13
github.com/gofiber/fiber/v2 GoAll versions2.52.13
github.com/gofiber/fiber/v2 GoAll versions2.52.13
github.com/gofiber/fiber/v3 GoAll versions3.2.0
github.com/gofiber/fiber/v3 GoAll versions3.2.0
github.com/gofiber/fiber/v3 GoAll versions3.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.

Sources

Also known as GHSA-qjv7-627w-8qjv, GO-2026-5585.

Is CVE-2026-42554 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free