CVE-2026-119285: Fiber: CORS wildcard origins matched without a dot boundary, allowing credentialed cross-origin reads
Summary In v2.52.1 and v2.52.2 the CORS middleware matched a wildcard origin such as https://.example.com by suffix only, without a dot boundary and without comparing the scheme. Any origin whose host ends with the base domain, for example https://evil-example.com or http://notexample.com, was reflected in Access-Control-Allow-Origin, together with Access-Control-Allow-Credentials: true when AllowCredentials is…
Published Oct 30, 2026
Affected packages
github.com/gofiber/fiber/v2
- Ecosystem
- Go
- Affected
- >= 2.52.1, <= 2.52.2
- Fixed in
- 2.52.3
- Check
go list -m github.com/gofiber/fiber/v2
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Summary
In v2.52.1 and v2.52.2 the CORS middleware matched a wildcard origin such as https://*.example.com by suffix only, without a dot boundary and without comparing the scheme. Any origin whose host ends with the base domain, for example https://evil-example.com or http://notexample.com, was reflected in Access-Control-Allow-Origin, together with Access-Control-Allow-Credentials: true when AllowCredentials is enabled.
v2.52.3 replaced the matcher (#2915) and is not affected. The report was filed against v2.52.15, where the dot boundary holds; see "Other versions" below.
Details
v2.52.1 introduced validateDomain in middleware/cors/utils.go (f0cd3b44, part of the fix for GHSA-fmg4-x8pw-hjhg). It strips scheme and port from both sides and then checks only the suffix, with trimmedPattern = "example.com", so the character before the suffix is never checked:
if strings.HasPrefix(normalizedPattern, "*.") {
trimmedPattern := normalizedPattern[2:]
if strings.HasSuffix(normalizedDomain, trimmedPattern) {
if normalizedDomain != trimmedPattern {
if strings.TrimSuffix(normalizedDomain, trimmedPattern) != "" {
return true
}
}
}
}v2.52.3 (1aac6f61, #2915) replaced it with a scheme-aware prefix/suffix split that keeps the leading dot in the suffix (.example.com).
Proof of concept
app := fiber.New()
app.Use(cors.New(cors.Config{
AllowOrigins: "https://*.example.com",
AllowCredentials: true,
}))
app.Get("/", func(c *fiber.Ctx) error { return c.SendString("secret") })Request with Origin: https://evil-example.com, as a GET and as a preflight (OPTIONS with Access-Control-Request-Method: GET):
| Version | `https://evil-example.com` | `http://evil-example.com` | | v2.52.0 | not allowed | not allowed | | v2.52.1, v2.52.2 | reflected, `Access-Control-Allow-Credentials: true` | reflected, `Access-Control-Allow-Credentials: true` | | v2.52.3 to v2.52.16 | not allowed | not allowed |
Impact
An app that configures a wildcard-subdomain AllowOrigins with AllowCredentials: true lets any page on a domain that ends with the base domain (for example notexample.com for *.example.com) read authenticated responses cross-origin. Fixed in v2.52.3; upgrade to the latest v2 release.
Other versions
All v2 releases before v2.52.16 also accepted origins with empty labels (https://.example.com, https://a..example.com), and v2.52.3 to v2.52.15 mis-parsed a wildcard entry after a comma and a space ("https://a.com, https://*.example.com"). No registrable domain produces such an origin, so these are hardening rather than part of this advisory. They are fixed in v2.52.16 (#4792).
References
- https://github.com/gofiber/fiber/security/advisories/GHSA-g5jq-qmqr-qrwf
- https://nvd.nist.gov/vuln/detail/CVE-2026-119285
- https://github.com/gofiber/fiber/pull/2915
- https://github.com/gofiber/fiber/commit/1aac6f618b6bd3e159d2449acb4232a2170b976b
- https://github.com/gofiber/fiber/releases/tag/v2.52.3
- https://github.com/advisories/GHSA-g5jq-qmqr-qrwf
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More Go vulnerabilities
All Go entriesCVE-2026-45045
GoFiber Vulnerable to X-Real-IP Spoofing via Header.Add() in BalancerForward
medium5.3Jul 2, 2026CVE-2026-42554
Fiber vulnerable to XSS in AutoFormat Content Negotiation
medium5.3May 5, 2026CVE-2026-25882
Fiber has a Denial of Service Vulnerability via Route Parameter Overflow
medium6.9Feb 24, 2026CVE-2025-66630
Fiber has an insecure fallback in utils.UUIDv4() / utils.UUID() — predictable / zero‑UUID on crypto/rand failure
critical9.2Feb 9, 2026CVE-2025-54801
Fiber Crashes in BodyParser Due to Unvalidated Large Slice Index in Decoder
high8.7Aug 5, 2025CVE-2025-48075
Fiber panics when fiber.Ctx.BodyParser parses invalid range index
high7.7May 22, 2025
