Go Fiber CSRF Token Validation Vulnerability
Published 17 Oct 2023 · Updated 10 Sept 2026
Is your project on an affected github.com/gofiber/fiber/v2?
Look after several Go apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie
Affected package
- Affected
- <2.50.0
- Fixed in
- 2.50.0
go get github.com/gofiber/fiber/v2@v2.50.0Details
A Cross-Site Request Forgery (CSRF) vulnerability has been identified in the application, which allows an attacker to obtain tokens and forge malicious requests on behalf of a user. This can lead to unauthorized actions being taken on the user's behalf, potentially compromising the security and integrity of the application.
Vulnerability Details
The vulnerability is caused by improper validation and enforcement of CSRF tokens within the application. The following issues were identified:
1. Lack of Token Association: The CSRF token was validated against tokens in storage but was not tied to the original requestor that generated it, allowing for token reuse.
Remediation
To remediate this vulnerability, it is recommended to take the following actions:
1. Update the Application: Upgrade the application to a fixed version with a patch for the vulnerability.
2. Implement Proper CSRF Protection: Review the updated documentation and ensure your application's CSRF protection mechanisms follow best practices.
4. Choose CSRF Protection Method: Select the appropriate CSRF protection method based on your application's requirements, either the Double Submit Cookie method or the Synchronizer Token Pattern using sessions.
5. Security Testing: Conduct a thorough security assessment, including penetration testing, to identify and address any other security vulnerabilities.
Defence-in-depth
Users should take additional security measures like captchas or Two-Factor Authentication (2FA) and set Session cookies with SameSite=Lax or SameSite=Strict, and the Secure and HttpOnly attributes.
Is GHSA-mv73-f69x-444p in any of your client repos?
Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected github.com/gofiber/fiber/v2, and gives you the command that fixes it.
More advisories for github.com/gofiber/fiber/v2
- LowCVE-2026-119285Fiber: CORS wildcard origins matched without a dot boundary, allowing credentialed cross-origin reads in github.com/gofiber/fiber · 5 Nov 2026
- MediumCVE-2026-119285Fiber: CORS wildcard origins matched without a dot boundary, allowing credentialed cross-origin reads · 30 Oct 2026
- LowCVE-2026-42554Fiber vulnerable to XSS in AutoFormat Content Negotiation in github.com/gofiber/fiber · 24 Jul 2026
- MediumCVE-2026-45045GoFiber Vulnerable to X-Real-IP Spoofing via Header.Add() in BalancerForward · 2 Jul 2026
- MediumCVE-2026-42554Fiber vulnerable to XSS in AutoFormat Content Negotiation · 5 May 2026
- LowCVE-2026-25882Fiber has a Denial of Service Vulnerability via Route Parameter Overflow in github.com/gofiber/fiber · 26 Feb 2026
References
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.