MEDIUM5.3
GO-2023-2052
IsFromLocal local address check can be circumvented in github.com/gofiber/fiber/v2
Quick fix
GO-2023-2052 — github.com/gofiber/fiber/v2: upgrade to the fixed version with the command below.
go get github.com/gofiber/fiber/v2@v2.49.2-0.20230906112033-b8c9ede6efa2Details
The Ctx.IsFromLocal function can incorrectly report a request as being sent from localhost when the request contains an X-Forwarded-For header containing a localhost IP address.
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.49.2-0.20230906112033-b8c9ede6efa2Fix
go get github.com/gofiber/fiber/v2@v2.49.2-0.20230906112033-b8c9ede6efa2References
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"]}'