MediumGHSA-3q5p-3558-364fCVE-2023-41338GO-2023-2052

Fiber unauthorized access vulnerability in `ctx.IsFromLocal()`

Published 8 Sept 2023 · Updated 10 Sept 2026

Is your project on an affected github.com/gofiber/fiber?

Private repo? Upload its lockfile instead, or connect GitHub to check every repo.

Look after several Go apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie

Affected packages

Affected
<=1.14.6
Fixed in
No fix released
Affected
<2.49.2
Fixed in
2.49.2
Update to the fixed version for your release line, for example:go get github.com/gofiber/fiber/v2@v2.49.2

Details

Impact

This vulnerability can be categorized as a security misconfiguration. It impacts users of our project who rely on the ctx.IsFromLocal() method to restrict access to localhost requests. If exploited, it could allow unauthorized access to resources intended only for localhost.

In it's implementation it uses c.IPs():

// IPs returns a string slice of IP addresses specified in the X-Forwarded-For request header.
// When IP validation is enabled, only valid IPs are returned.
func (c *Ctx) IPs() []string {
    return c.extractIPsFromHeader(HeaderXForwardedFor)
}

Thereby, setting X-Forwarded-For: 127.0.0.1 in a request from a foreign host, will result in true for ctx.IsFromLocal()

Patches

This issue has been patched in v2.49.2 with commit b8c9ede6efa231116c4bd8bb9d5e03eac1cb76dc

Workarounds

Currently, there are no known workarounds to remediate this vulnerability without upgrading to the patched version. We strongly advise users to apply the patch as soon as it is released.

References

For further information and context regarding this security issue, please refer to the following resources:

Is GHSA-3q5p-3558-364f 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, and gives you the command that fixes it.

More advisories for github.com/gofiber/fiber

  • MediumCVE-2026-53624GoFiber never set HSTS header in helmet middleware due to incorrect protocol check · 6 Jul 2026
  • LowCVE-2025-66630Fiber has an insecure fallback in utils.UUIDv4() / utils.UUID() on crypto/rand failure in github.com/gofiber/fiber · 19 Feb 2026
  • LowCVE-2025-48075Fiber panics when fiber.Ctx.BodyParser parses invalid range index in github.com/gofiber/fiber · 27 May 2025
  • LowCVE-2024-38513Session Middleware Token Injection Vulnerability in github.com/gofiber/fiber · 2 Jul 2024
  • CriticalCVE-2024-38513Session Middleware Token Injection Vulnerability · 1 Jul 2024
  • LowCVE-2020-15111CRLF vulnerability in Fiber in github.com/gofiber/fiber · 28 Jul 2021
All 8 advisories for github.com/gofiber/fiber

References

Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.