CVE-2024-38513 Fiber Session Middleware Token Injection Vulnerability

Critical 10.0 Published Updated

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.

PackageAffectedFixed in
github.com/gofiber/fiber GoAll versionsNone
github.com/gofiber/fiber GoAll versions2.52.5
github.com/gofiber/fiber GoAll versions2.52.5
github.com/gofiber/fiber/v2 GoAll versions2.52.5
github.com/gofiber/fiber/v2 GoAll versions2.52.5
github.com/gofiber/fiber/v2 GoAll versions2.52.5
2 more packages
github.com/gofiber/fiber/v2/middleware/session GoAll versions2.52.5
github.com/gofiber/fiber/v2/middleware/session GoAll versions2.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.

Sources

Also known as GHSA-98j2-3j3p-fw2v, GO-2024-2959.

Is CVE-2024-38513 in your software?

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

Check your SBOMs for free