Fiber: X-Real-IP Spoofing via Header.Add() in BalancerForward
gofiber fiber
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| github.com/gofiber/fiber/v3 Go |
|
|
| github.com/gofiber/fiber/v2 Go |
|
|
gofiber fiber
| Product | Affected | Fixed in |
|---|---|---|
| github.com/gofiber/fiber/v3 Go |
|
|
| github.com/gofiber/fiber/v2 Go |
|
|
Fiber’s BalancerForward proxy helper can forward an attacker-supplied X-Real-IP value to upstream servers. When an application uses this helper, a remote attacker can affect upstream logging, rate limiting, or access control; authentication requirements are not specified, and no user interaction is described.
Teams using Go github.com/gofiber/fiber/v3 before 3.3.0 or github.com/gofiber/fiber/v2 before 2.52.14 should check their applications.
Fiber is an Express inspired web framework written in Go. Prior to 3.3.0 and 2.52.14, the BalancerForward proxy helper in middleware/proxy/proxy.go uses Header.Add() instead of Header.Set() when injecting X-Real-IP, allowing an attacker-supplied first X-Real-IP value to be forwarded to upstream servers for logging, rate limiting, and access control. This issue is fixed in version 3.3.0 and 2.52.14.
From the CVE record · GitHub_M