VDB
Sign up
HIGH8.8

GO-2023-2115

CSRF token reuse vulnerability in github.com/gofiber/fiber/v2

Quick fix

GO-2023-2115 — github.com/gofiber/fiber/v2: upgrade to the fixed version with the command below.

go get github.com/gofiber/fiber/v2@v2.50.0

Details

A cross-site request forgery vulnerability in this package can allow an attacker to inject arbitrary values and forge malicious requests on behalf of a user. The attacker may inject arbitrary values without any authentication, or perform various malicious actions on behalf of an authenticated user, potentially compromising the security and integrity of the application.

The vulnerability is caused by improper validation and enforcement of CSRF tokens within the application. For 'safe' methods, the token is extracted from the cookie and saved to storage without further validation or sanitization. In addition, the CSRF token is validated against tokens in storage but not associated with a session, nor by using a Double Submit Cookie Method, allowing for token reuse.

Are you affected?

Enter the version of the package you're using.

Affected packages

Go/github.com/gofiber/fiber/v2
Introduced in: 0Fixed in: 2.50.0
Fixgo get github.com/gofiber/fiber/v2@v2.50.0

References

Check it before you install it

One call answers whether to add this package: known advisories, CISA KEV, and whether the name is a hallucinated or freshly squatted one. No key needed to try it.

curl -s https://vdb.ai.kr/v1/ai/check-packages \
  -H 'Content-Type: application/json' \
  -d '{"packages":["pkg:golang/github.com/gofiber/fiber/v2"]}'