Skip to content

Session Middleware Token Injection Vulnerability

Critical severity GitHub Reviewed Published Jun 30, 2024 in gofiber/fiber • Updated Jul 5, 2024

Package

gomod github.com/gofiber/fiber (Go)

Affected versions

<= 2.52.4

Patched versions

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

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.

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:

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

References

@ReneWerner87 ReneWerner87 published to gofiber/fiber Jun 30, 2024
Published by the National Vulnerability Database Jul 1, 2024
Published to the GitHub Advisory Database Jul 1, 2024
Reviewed Jul 1, 2024
Last updated Jul 5, 2024

Severity

Critical

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Changed
Confidentiality
High
Integrity
High
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H

EPSS score

0.043%
(10th percentile)

Weaknesses

CVE ID

CVE-2024-38513

GHSA ID

GHSA-98j2-3j3p-fw2v

Source code

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.