CVE-2024-38513 Fiber Session Middleware Token Injection Vulnerability
Attackers can inject session IDs in GoFiber, enabling session fixation and unauthorized access if server-side validation is missing.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2024-38513?
CVE-2024-38513 is a critical authentication bypass vulnerability in gofiber fiber, published on 1 Jul 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
Fiber is an Express-inspired web framework written in Go A vulnerability present in versions prior to 2.52.5 is a session middleware issue in GoFiber versions 2 and above. This vulnerability allows users to supply their own session_id value, resulting in the creation of a session with that key. If a website relies on the mere presence of a session for security purposes, this can lead to significant security risks, including unauthorized access and session fixation attacks. All users utilizing GoFiber's session middleware in the affected versions are impacted. The issue has been addressed in version 2.52.5. Users are strongly encouraged to upgrade to version 2.52.5 or higher to mitigate this vulnerability. Users who are unable to upgrade immediately can apply the following workarounds to reduce the risk: Either implement additional validation to ensure session IDs are not supplied by the user and are securely generated by the server, or regularly rotate session IDs and enforce strict session expiration policies.
Weakness: CWE-384
Which versions are affected by CVE-2024-38513?
8 open source packages ship an affected version, including github.com/gofiber/fiber, github.com/gofiber/fiber/v2 and github.com/gofiber/fiber/v2/middleware/session. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
github.com/gofiber/fiber Go | All versions | None |
github.com/gofiber/fiber Go | All versions | 2.52.5 |
github.com/gofiber/fiber Go | All versions | 2.52.5 |
github.com/gofiber/fiber/v2 Go | All versions | 2.52.5 |
github.com/gofiber/fiber/v2 Go | All versions | 2.52.5 |
github.com/gofiber/fiber/v2 Go | All versions | 2.52.5 |
2 more packages
github.com/gofiber/fiber/v2/middleware/session Go | All versions | 2.52.5 |
github.com/gofiber/fiber/v2/middleware/session Go | All versions | 2.52.5 |
Products include Gofiber Fiber.
How do I fix CVE-2024-38513?
Upgrade github.com/gofiber/fiber to 2.52.5 or later.
Upgrade, and rotate credentials and sessions that may have been exposed. More about Authentication bypass.
Is CVE-2024-38513 being exploited?
There is no known exploitation of CVE-2024-38513 in the wild and no public exploit code.
Other vulnerabilities in gofiber fiber
- 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
- CVE-2023-45141 CSRF Token Validation Vulnerability in fiber
Sources
Also known as GHSA-98j2-3j3p-fw2v, GO-2024-2959.