CVE-2024-38513

CVE-2024-38513 is a critical-severity security vulnerability in github.com/gofiber/fiber (go), affecting versions <= 2.52.4. It is fixed in 2.52.5.

Summary

Session Middleware Token Injection Vulnerability

Full technical description

A security vulnerability has been identified in the Fiber session middleware where a user can supply their own session_id value, leading to the creation of a session with that key.

Workarounds

Users who are unable to upgrade immediately can apply the following workarounds to reduce the risk:

  1. Validate Session IDs: Implement additional validation to ensure session IDs are not supplied by the user and are securely generated by the server.
  2. Session Management: Regularly rotate session IDs and enforce strict session expiration policies.

References

For more information on session best practices:

Users are encouraged to review these references and take immediate action to secure their applications.

Impact

The identified vulnerability 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.

CVE-2024-38513 has a CVSS score of 10.0 (Critical). The vector is network-reachable, no privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (2.52.5); upgrading removes the vulnerable code path.

Affected versions

github.com/gofiber/fiber (<= 2.52.4) github.com/gofiber/fiber/v2 (<= 2.52.4) github.com/gofiber/fiber/v2/middleware/session (<= 2.52.4)

Security releases

github.com/gofiber/fiber → 2.52.5 (go) github.com/gofiber/fiber/v2 → 2.52.5 (go) github.com/gofiber/fiber/v2/middleware/session → 2.52.5 (go)

Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.

Already deployed Kodem?

See it in your environmentNew to Kodem? Get a demo →

Remediation advice

The issue has been addressed in the latest patch. Users are strongly encouraged to upgrade to version 2.52.5 or higher to mitigate this vulnerability.

Frequently Asked Questions

  1. What is CVE-2024-38513? CVE-2024-38513 is a critical-severity security vulnerability in github.com/gofiber/fiber (go), affecting versions <= 2.52.4. It is fixed in 2.52.5.
  2. How severe is CVE-2024-38513? CVE-2024-38513 has a CVSS score of 10.0 (Critical). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
  3. Which packages are affected by CVE-2024-38513?
    • github.com/gofiber/fiber (go) (versions <= 2.52.4)
    • github.com/gofiber/fiber/v2 (go) (versions <= 2.52.4)
    • github.com/gofiber/fiber/v2/middleware/session (go) (versions <= 2.52.4)
  4. Is there a fix for CVE-2024-38513? Yes. CVE-2024-38513 is fixed in 2.52.5. Upgrade to this version or later.
  5. Is CVE-2024-38513 exploitable, and should I be worried? Whether CVE-2024-38513 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
  6. What actually determines whether CVE-2024-38513 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
  7. How do I fix CVE-2024-38513?
    • Upgrade github.com/gofiber/fiber to 2.52.5 or later
    • Upgrade github.com/gofiber/fiber/v2 to 2.52.5 or later
    • Upgrade github.com/gofiber/fiber/v2/middleware/session to 2.52.5 or later

Other vulnerabilities in github.com/gofiber/fiber

Stop the waste.
Protect your environment with Kodem.