CVE-2023-41338
published 2023-09-08CVE-2023-41338: 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…
PriorityP429medium5.3CVSS 3.1
AVNACLPRNUINSUCLINAN
EPSS
0.53%
40.8th percentile
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.
Affected
4 ranges
| Vendor | Product | Version range | Fixed in |
|---|---|---|---|
| github.com | gofiber_fiber | 0 – 1.14.6 | — |
| github.com | gofiber_fiber_v2 | >= 0 < 2.49.2-0.20230906112033-b8c9ede6efa2 | 2.49.2-0.20230906112033-b8c9ede6efa2 |
| github.com | gofiber_fiber_v2 | >= 0 < 2.49.2 | 2.49.2 |
| gofiber | fiber | < 2.49.2 | 2.49.2 |
Stop checking back — get the weekly exploitation signal.
Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.
OSV
IsFromLocal local address check can be circumvented in github.com/gofiber/fiber/v2
osv·2023-09-12
CVE-2023-41338 IsFromLocal local address check can be circumvented in github.com/gofiber/fiber/v2
IsFromLocal local address check can be circumvented in github.com/gofiber/fiber/v2
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.
GHSA
Fiber unauthorized access vulnerability in `ctx.IsFromLocal()`
ghsa·2023-09-08
CVE-2023-41338 [MEDIUM] CWE-670 Fiber unauthorized access vulnerability in `ctx.IsFromLocal()`
Fiber unauthorized access vulnerability in `ctx.IsFromLocal()`
### Impact
This vulnerability can be categorized as a security misconfiguration. It impacts users of our project who rely on the [ctx.IsFromLocal()](https://docs.gofiber.io/api/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():
```go
// 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 [ct
OSV
Fiber unauthorized access vulnerability in `ctx.IsFromLocal()`
osv·2023-09-08
CVE-2023-41338 [MEDIUM] Fiber unauthorized access vulnerability in `ctx.IsFromLocal()`
Fiber unauthorized access vulnerability in `ctx.IsFromLocal()`
### Impact
This vulnerability can be categorized as a security misconfiguration. It impacts users of our project who rely on the [ctx.IsFromLocal()](https://docs.gofiber.io/api/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():
```go
// 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 [ct
No detection rules found.
No public exploits indexed.
No writeups or analysis indexed.
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Forhttps://docs.gofiber.io/api/ctx#isfromlocalhttps://github.com/gofiber/fiber/commit/b8c9ede6efa231116c4bd8bb9d5e03eac1cb76dchttps://github.com/gofiber/fiber/security/advisories/GHSA-3q5p-3558-364fhttps://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Forhttps://docs.gofiber.io/api/ctx#isfromlocalhttps://github.com/gofiber/fiber/commit/b8c9ede6efa231116c4bd8bb9d5e03eac1cb76dchttps://github.com/gofiber/fiber/security/advisories/GHSA-3q5p-3558-364f
2023-09-08
Published