Vulnerabilities in pkg:golang/github.com/gofiber/fiber/v3

PACKAGE
Advisory Identifier: GHSA-gcfq-8gqf-4876
Advisory Summary

CVE-2026-45045 is a MODERATE (CVSS 5.3) gofiber vulnerable to x-real-ip spoofing vulnerability (CWE-290: Authentication Bypass by Spoofing) affecting Github.com/gofiber/fiber/v3 libraries in the Go ecosystem. The issue involves gofiber vulnerable to x-real-ip spoofing via header.add() in balancerforward. Remediation is available by upgrading affected packages to version 3.3.0, 2.52.14.

7 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:golang/github.com/gofiber/fiber/v3

7 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:golang/github.com/gofiber/fiber/v3. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-gcfq-8gqf-4876 CVE-2026-45045 MODERATE GoFiber Vulnerable to X-Real-IP Spoofing via Header.Add() in BalancerForward
GHSA-g5vh-55hw-rxm8 CVE-2026-44332 MODERATE GoFiber Vulnerable to Username Enumeration via Timing Oracle in BasicAuth Default Authorizer
GHSA-qjv7-627w-8qjv CVE-2026-42554 MODERATE Fiber vulnerable to XSS in AutoFormat Content Negotiation
GHSA-35hp-hqmv-8qg8 CVE-2026-30246 MODERATE Fiber's cache middleware default key generator ignores query string, causing response mix-up across distinct query parameters
GHSA-2mr3-m5q5-wgp6 CVE-2026-25899 HIGH Fiber is Vulnerable to Denial of Service via Flash Cookie Unbounded Allocation
GHSA-mrq8-rjmw-wpq3 CVE-2026-25882 MODERATE Fiber has a Denial of Service Vulnerability via Route Parameter Overflow
GHSA-m3c2-496v-cw3v CVE-2026-25891 HIGH Fiber has an Arbitrary File Read in Static Middleware on Windows

CVE-2026-45045 at a Glance

CVE Identifier CVE-2026-45045
GHSA Identifier GHSA-gcfq-8gqf-4876
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-290: Authentication Bypass by Spoofing
Affected Product Github.com/gofiber/fiber/v3
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 5.3

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2026-45045

To remediate this vulnerability, upgrade all affected Github.com/gofiber/fiber/v3 dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/gofiber/fiber/v3 fixed: 3.3.0
Upgrade github.com/gofiber/fiber/v3 to 3.3.0
github.com/gofiber/fiber/v2 fixed: 2.52.14
Upgrade github.com/gofiber/fiber/v2 to 2.52.14
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/gofiber/fiber/v3

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-45045, inspect your project dependencies for Github.com/gofiber/fiber/v3:

inspect dependencies for github.com/gofiber/fiber/v3

Analyze the terminal output to locate any version of Github.com/gofiber/fiber/v3 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.3.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-290: Authentication Bypass by Spoofing, where this attack-focused weakness is caused by incorrectly implemented authentication schemes that are subject to spoofing attacks. In Github.com/gofiber/fiber/v3, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## Summary The `BalancerForward` proxy helper in GoFiber uses `Header.Add()` instead of `Header.Set()` when injecting the `X-Real-IP` header. This appends the real client IP as a second header value rather than replacing any attacker-supplied value. Upstream servers that read the first `X-Real-IP` header (nginx, Express, most HTTP servers) use the attacker's spoofed IP for logging, rate limiting, and access control. ## Vulnerable Code **File:** `middleware/proxy/proxy.go`, lines 270-285 ```go func BalancerForward(servers []string, clients ...*fasthttp.Client) fiber.Handler { r := &roundrobin{ current: 0, pool: servers, } return func(c fiber.Ctx) error { server := r.get() if !strings.HasPrefix(server, "http") { server = "http://" + server } c.Request().Header.Add("X-Real-IP", c.IP()) // line 282: Add, not Set return Do(c, server+c.OriginalURL(), clients...) } } ``` ## Data Flow 1. Attacker sends request with `X-Real-IP: 10.0.0.1` (spoofed internal IP) 2. `BalancerForward` handler executes at line 282 3. `c.Request().Header.Add("X-Real-IP", c.IP())` APPENDS the real IP as a second header 4. Upstream server receives: `X-Real-IP: 10.0.0.1` AND `X-Real-IP: <real-attacker-ip>` 5. Most HTTP servers (nginx, Node.js, Apache) read the FIRST value 6. Upstream uses `10.0.0.1` for all IP-dependent logic ## Impact - **Rate limit bypass:** IP-based rate limiting at the upstream uses the spoofed IP, allowing unlimited requests - **IP ACL bypass:** Internal IP allowlists (e.g., admin panels restricted to `10.0.0.0/8`) can be bypassed - **Audit log poisoning:** Security logs record the spoofed IP, making incident investigation unreliable - **Geolocation bypass:** IP-based geofencing or region restrictions are circumvented ## Fix Replace `Header.Add()` with `Header.Set()` at line 282: ```go c.Request().Header.Set("X-Real-IP", c.IP()) ``` `Header.Set()` replaces any existing header value, ensuring only the real client IP is forwarded.

CVE-2026-45045 Affected Github.com/gofiber/fiber/v3 Versions

2 component(s)
Fixed Versions:
3.3.02.52.14
Product / Package Ecosystem Affected Versions Fixed Version
github.com/gofiber/fiber/v3
Go
< 3.3.0
3.3.0
github.com/gofiber/fiber/v2
Go
< 2.52.14
2.52.14

References

Frequently Asked Questions

What is CVE-2026-45045?
CVE-2026-45045 is a security vulnerability in Github.com/gofiber/fiber/v3 involving GoFiber Vulnerable to X-Real-IP Spoofing via Header.Add() in BalancerForward under CWE-290: Authentication Bypass by Spoofing.
Which Github.com/gofiber/fiber/v3 versions are affected?
Affected versions include releases prior to 3.3.0, 2.52.14 across affected packages: github.com/gofiber/fiber/v3, github.com/gofiber/fiber/v2.
What version fixes CVE-2026-45045?
Upgrading to 3.3.0, 2.52.14 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/gofiber/fiber/v3 affected?
Yes, github.com/gofiber/fiber/v3 is affected in releases prior to 3.3.0. Upgrade your dependency to 3.3.0 or later.
Is github.com/gofiber/fiber/v2 affected?
Yes, github.com/gofiber/fiber/v2 is affected in releases prior to 2.52.14. Upgrade your dependency to 2.52.14 or later.
What is the CVSS score of CVE-2026-45045?
CVE-2026-45045 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N.
What CWE is associated with CVE-2026-45045?
CVE-2026-45045 is classified under CWE-290: Authentication Bypass by Spoofing (This attack-focused weakness is caused by incorrectly implemented authentication schemes that are subject to spoofing attacks.).
How can I check Go dependencies for CVE-2026-45045?
Run the dependency tree command: 'inspect dependencies for github.com/gofiber/fiber/v3'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-gcfq-8gqf-4876",
  "modified" : "2026-08-04T21:52:02Z",
  "published" : "2026-07-02T13:50:45Z",
  "aliases" : [ "CVE-2026-45045" ],
  "summary" : "GoFiber Vulnerable to X-Real-IP Spoofing via Header.Add() in BalancerForward",
  "details" : "## Summary\n\nThe `BalancerForward` proxy helper in GoFiber uses `Header.Add()` instead of `Header.Set()` when injecting the `X-Real-IP` header. This appends the real client IP as a second header value rather than replacing any attacker-supplied value. Upstream servers that read the first `X-Real-IP` header (nginx, Express, most HTTP servers) use the attacker's spoofed IP for logging, rate limiting, and access control.\n\n## Vulnerable Code\n\n**File:** `middleware/proxy/proxy.go`, lines 270-285\n\n```go\nfunc BalancerForward(servers []string, clients ...*fasthttp.Client) fiber.Handler {\n    r := &roundrobin{\n        current: 0,\n        pool:    servers,\n    }\n    return func(c fiber.Ctx) error {\n        server := r.get()\n        if !strings.HasPrefix(server, \"http\") {\n            server = \"http://\" + server\n        }\n        c.Request().Header.Add(\"X-Real-IP\", c.IP())   // line 282: Add, not Set\n        return Do(c, server+c.OriginalURL(), clients...)\n    }\n}\n```\n\n## Data Flow\n\n1. Attacker sends request with `X-Real-IP: 10.0.0.1` (spoofed internal IP)\n2. `BalancerForward` handler executes at line 282\n3. `c.Request().Header.Add(\"X-Real-IP\", c.IP())` APPENDS the real IP as a second header\n4. Upstream server receives: `X-Real-IP: 10.0.0.1` AND `X-Real-IP: <real-attacker-ip>`\n5. Most HTTP servers (nginx, Node.js, Apache) read the FIRST value\n6. Upstream uses `10.0.0.1` for all IP-dependent logic\n\n## Impact\n\n- **Rate limit bypass:** IP-based rate limiting at the upstream uses the spoofed IP, allowing unlimited requests\n- **IP ACL bypass:** Internal IP allowlists (e.g., admin panels restricted to `10.0.0.0/8`) can be bypassed\n- **Audit log poisoning:** Security logs record the spoofed IP, making incident investigation unreliable\n- **Geolocation bypass:** IP-based geofencing or region restrictions are circumvented\n\n## Fix\n\nReplace `Header.Add()` with `Header.Set()` at line 282:\n\n```go\nc.Request().Header.Set(\"X-Real-IP\", c.IP())\n```\n\n`Header.Set()` replaces any existing header value, ensuring only the real client IP is forwarded.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/gofiber/fiber/v3"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.3.0"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 3.2.0"
    }
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/gofiber/fiber/v2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.52.14"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 2.52.13"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/gofiber/fiber/security/advisories/GHSA-gcfq-8gqf-4876"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-45045"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/gofiber/fiber/pull/4260"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/gofiber/fiber/pull/4495"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/gofiber/fiber/commit/1403cc8292da3220e9316960b4030cc722a0f396"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/gofiber/fiber/commit/33c9501288ab47a429c8b5e701493f0c3c0af37d"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/gofiber/fiber"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/gofiber/fiber/releases/tag/v2.52.14"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/gofiber/fiber/releases/tag/v3.3.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-290" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-07-02T13:50:45Z",
    "nvd_published_at" : "2026-07-08T20:16:50Z"
  }
}