Vulnerabilities in pkg:golang/github.com/gofiber/fiber/v2/middleware/session

PACKAGE
Advisory Identifier: GHSA-98j2-3j3p-fw2v
Advisory Summary

CVE-2024-38513 is a CRITICAL (CVSS 10.0) session middleware token injection vulnerability vulnerability (CWE-384: Session Fixation) affecting Github.com/gofiber/fiber libraries in the Go ecosystem. The issue involves session middleware token injection vulnerability. Remediation is available by upgrading affected packages to version 2.52.5.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:golang/github.com/gofiber/fiber/v2/middleware/session

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:golang/github.com/gofiber/fiber/v2/middleware/session. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-98j2-3j3p-fw2v CVE-2024-38513 CRITICAL Session Middleware Token Injection Vulnerability

CVE-2024-38513 at a Glance

CVE Identifier CVE-2024-38513
GHSA Identifier GHSA-98j2-3j3p-fw2v
Severity CRITICAL
CVSS v3.1 Base Score 10.0
CWE Classification CWE-384: Session Fixation
Affected Product Github.com/gofiber/fiber
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 10.0

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2024-38513

To remediate this vulnerability, upgrade all affected Github.com/gofiber/fiber dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/gofiber/fiber fixed: 2.52.5
Upgrade github.com/gofiber/fiber to 2.52.5
github.com/gofiber/fiber/v2 fixed: 2.52.5
Upgrade github.com/gofiber/fiber/v2 to 2.52.5
github.com/gofiber/fiber/v2/middleware/session fixed: 2.52.5
Upgrade github.com/gofiber/fiber/v2/middleware/session to 2.52.5
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/gofiber/fiber

How to Check if You Are Affected

To determine whether your application is affected by CVE-2024-38513, inspect your project dependencies for Github.com/gofiber/fiber:

inspect dependencies for github.com/gofiber/fiber

Analyze the terminal output to locate any version of Github.com/gofiber/fiber in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.52.5), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-384: Session Fixation, where authenticating a user, or otherwise establishing a new user session, without invalidating any existing session identifier gives an attacker the opportunity to steal authenticated sessions. In Github.com/gofiber/fiber, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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. ## 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. ## Patches 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. ## 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: - [OWASP Session Management Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Session_Management_Cheat_Sheet.html) Users are encouraged to review these references and take immediate action to secure their applications.

CVE-2024-38513 Affected Github.com/gofiber/fiber Versions

3 component(s)
Fixed Versions:
2.52.5
Product / Package Ecosystem Affected Versions Fixed Version
github.com/gofiber/fiber
Go
< 2.52.5
2.52.5
github.com/gofiber/fiber/v2
Go
< 2.52.5
2.52.5
github.com/gofiber/fiber/v2/middleware/session
Go
< 2.52.5
2.52.5

References

Frequently Asked Questions

What is CVE-2024-38513?
CVE-2024-38513 is a security vulnerability in Github.com/gofiber/fiber involving Session Middleware Token Injection Vulnerability under CWE-384: Session Fixation.
Which Github.com/gofiber/fiber versions are affected?
Affected versions include releases prior to 2.52.5 across affected packages: github.com/gofiber/fiber, github.com/gofiber/fiber/v2, github.com/gofiber/fiber/v2/middleware/session.
What version fixes CVE-2024-38513?
Upgrading to 2.52.5 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/gofiber/fiber affected?
Yes, github.com/gofiber/fiber is affected in releases prior to 2.52.5. Upgrade your dependency to 2.52.5 or later.
Is github.com/gofiber/fiber/v2 affected?
Yes, github.com/gofiber/fiber/v2 is affected in releases prior to 2.52.5. Upgrade your dependency to 2.52.5 or later.
What is the CVSS score of CVE-2024-38513?
CVE-2024-38513 has a CVSS v3.1 base score of 10.0 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H.
What CWE is associated with CVE-2024-38513?
CVE-2024-38513 is classified under CWE-384: Session Fixation (Authenticating a user, or otherwise establishing a new user session, without invalidating any existing session identifier gives an attacker the opportunity to steal authenticated sessions.).
How can I check Go dependencies for CVE-2024-38513?
Run the dependency tree command: 'inspect dependencies for github.com/gofiber/fiber'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-98j2-3j3p-fw2v",
  "modified" : "2025-10-02T15:37:56Z",
  "published" : "2024-07-01T20:35:03Z",
  "aliases" : [ "CVE-2024-38513" ],
  "summary" : "Session Middleware Token Injection Vulnerability",
  "details" : "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.\n\n## Impact\nThe 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.\n\n## Patches\nThe 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.\n\n## Workarounds\nUsers who are unable to upgrade immediately can apply the following workarounds to reduce the risk:\n\n1. **Validate Session IDs**: Implement additional validation to ensure session IDs are not supplied by the user and are securely generated by the server.\n2. **Session Management**: Regularly rotate session IDs and enforce strict session expiration policies.\n\n## References\nFor more information on session best practices:\n- [OWASP Session Management Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Session_Management_Cheat_Sheet.html)\n\nUsers are encouraged to review these references and take immediate action to secure their applications.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/gofiber/fiber"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.52.5"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 2.52.4"
    }
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/gofiber/fiber/v2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.52.5"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 2.52.4"
    }
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/gofiber/fiber/v2/middleware/session"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.52.5"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 2.52.4"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/gofiber/fiber/security/advisories/GHSA-98j2-3j3p-fw2v"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-38513"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/gofiber/fiber/commit/66a881441b27322a331f1b526cf1eb6b3358a4d8"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/gofiber/fiber/commit/7926e5bf4da03e54f62d27d53229d35b264cba8e"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/gofiber/fiber"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-384" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-07-01T20:35:03Z",
    "nvd_published_at" : "2024-07-01T19:15:05Z"
  }
}