Vulnerabilities in pkg:golang/github.com/gofiber/fiber/v2/middleware/session
PACKAGECVE-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.
pkg:golang/github.com/gofiber/fiber/v2/middleware/session
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
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).
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.
Upgrade github.com/gofiber/fiber to 2.52.5
Upgrade github.com/gofiber/fiber/v2 to 2.52.5
Upgrade github.com/gofiber/fiber/v2/middleware/session to 2.52.5
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
CVE-2024-38513 Affected Github.com/gofiber/fiber Versions
3 component(s)| 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?
Which Github.com/gofiber/fiber versions are affected?
What version fixes CVE-2024-38513?
Is github.com/gofiber/fiber affected?
Is github.com/gofiber/fiber/v2 affected?
What is the CVSS score of CVE-2024-38513?
What CWE is associated with CVE-2024-38513?
How can I check Go dependencies for CVE-2024-38513?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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"
}
}