🛡️ CVE-2024-25124 — fiber
Description
Fiber has Insecure CORS Configuration, Allowing Wildcard Origin with Credentials
The CORS middleware allows for insecure configurations that could potentially expose the application to multiple CORS-related vulnerabilities. Specifically, it allows setting the Access-Control-Allow-Origin header to a wildcard ("*") while also having the Access-Control-Allow-Credentials set to true, which goes against recommended security best practices.
Impact
The impact of this misconfiguration is high as it can lead to unauthorized access to sensitive user data and expose the system to various types of attacks listed in the PortSwigger article linked in the references.
Proof of Concept
The code in cors.go allows setting a wildcard in the AllowOrigins while having AllowCredentials set to true, which could lead to various vulnerabilities.
Potential Solution
Here is a potential solution to ensure the CORS configuration is secure:
```go
func New(config ...Config) fiber.Handler {
if cfg.AllowCredentials && cfg.AllowOrigins == "*" {
panic("[CORS] Insecure setup, 'AllowCredentials' is set to true, and 'AllowOrigins' is set to a wildcard.")
}
// Return new handler goes below
}
The middleware will not allow insecure configurations when using AllowCredentials and AllowOrigins.
```
Workarounds
For the meantime, users are advised to manually validate the CORS configurations in their implementation to ensure that they do not allow a wildcard origin when credentials are enabled. The browser fetch api, browsers and utilities that enforce CORS policies are not affected by this.
References
[MDN Web Docs on CORS Errors](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS/Errors/CORSNotSupportingCredentials)
[CodeQL on CORS Misconfiguration](https://codeql.github.com/codeql-query-help/javascript/js-cors-misconfiguration-for-credentials/)
[PortSwigger on Exploiting CORS Misconfigurations](http://blog.portswigger.net/2016/10/exploiting-cors-misconfigurations-for.html)
[WhatWG CORS protocol and credentials ](https://fetch.spec.whatwg.org/#cors-protocol-and-credentials)
How this vulnerability can be exploited
This issue can be reached over the network, attack complexity is low, an attacker needs no privileges on the target. No user interaction is required. The scope is unchanged, so the impact stays within the vulnerable component. Rated impact: confidentiality high, integrity high, availability low.
Weakness class
CVE-2024-25124 is classified as CWE-346: Origin Validation Error. The origin of a message or request is not verified properly, so one source can pose as another.
Affected software
CVE-2024-25124 is recorded against 2 packages.
- fiber (fixed in 2.52.1)
- github.com/gofiber/fiber/v2
Timeline and source
Published on 21 February 2024 and last revised on 17 June 2026. A public exploit is known to exist, which raises the urgency of patching considerably. A vendor advisory or fix has been published. Record sourced from NVD.
References
blog.portswigger.net
codeql.github.com
developer.mozilla.org
fetch.spec.whatwg.org
github.com
github.com
github.com
saturncloud.io
blog.portswigger.net
codeql.github.com
developer.mozilla.org
fetch.spec.whatwg.org
github.com
github.com
github.com
Details
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:L
Affected Packages
| Software | From version | Fixed in |
|---|---|---|
| fiber | — | 2.52.1 |
| github.com/gofiber/fiber/v2 | — | — |
References
Similar Threats
- Medium CVE-2026-53624
- Medium CVE-2026-44332
- Medium CVE-2026-45045
- Medium CVE-2026-42554
- Medium CVE-2026-30246
More CVE 2024 advisories
Browse all of CVE 2024 in the advisory index.
Exploit Protection
Are you running fiber?
CVE-2024-25124 carries CVSS 9.5 Critical rating and a public exploit already exists. BotEraser checks your installation against this and other known CVE records, and blocks IPs associated with exploit activity.
Check My Site For CVE-2024-25124 →No credit card required · Results in minutes
ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.