Skip to content

fix(deps): update module github.com/gofiber/fiber/v2 to v2.52.14 [security] - #92

Open
renovate[bot] wants to merge 1 commit into
masterfrom
renovate/go-github.com-gofiber-fiber-v2-vulnerability
Open

renovate[bot] wants to merge 1 commit into
masterfrom
renovate/go-github.com-gofiber-fiber-v2-vulnerability

Conversation

@renovate

@renovate renovate Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Change Age Confidence
github.com/gofiber/fiber/v2 v2.52.13 → v2.52.14 age confidence

GoFiber Vulnerable to X-Real-IP Spoofing via Header.Add() in BalancerForward

CVE-2026-45045 / GHSA-gcfq-8gqf-4876

More information

Details

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

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:

c.Request().Header.Set("X-Real-IP", c.IP())

Header.Set() replaces any existing header value, ensuring only the real client IP is forwarded.

Severity

  • CVSS Score: 5.3 / 10 (Medium)
  • Vector String: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Release Notes

gofiber/fiber (github.com/gofiber/fiber/v2)

v2.52.14

Compare Source

What's Changed

🐛 Bug Fixes

New Contributors

Full Changelog: gofiber/fiber@v2.52.13...v2.52.14


Configuration

📅 Schedule: (UTC)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate Bot changed the title fix(deps): update module github.com/gofiber/fiber/v2 to v2.52.14 [security] fix(deps): update module github.com/gofiber/fiber/v2 to v2.52.14 [security] - autoclosed Aug 29, 2026
@renovate renovate Bot closed this Aug 29, 2026
@renovate
renovate Bot deleted the renovate/go-github.com-gofiber-fiber-v2-vulnerability branch August 29, 2026 21:08
@renovate renovate Bot changed the title fix(deps): update module github.com/gofiber/fiber/v2 to v2.52.14 [security] - autoclosed fix(deps): update module github.com/gofiber/fiber/v2 to v2.52.14 [security] Aug 30, 2026
@renovate renovate Bot reopened this Aug 30, 2026
@renovate
renovate Bot force-pushed the renovate/go-github.com-gofiber-fiber-v2-vulnerability branch 2 times, most recently from a2d7aaa to 61e74e7 Compare August 30, 2026 05:54
@renovate renovate Bot changed the title fix(deps): update module github.com/gofiber/fiber/v2 to v2.52.14 [security] fix(deps): update module github.com/gofiber/fiber/v2 to v2.52.14 [security] - autoclosed Aug 30, 2026
@renovate renovate Bot closed this Aug 30, 2026
@renovate renovate Bot changed the title fix(deps): update module github.com/gofiber/fiber/v2 to v2.52.14 [security] - autoclosed fix(deps): update module github.com/gofiber/fiber/v2 to v2.52.14 [security] Aug 30, 2026
@renovate renovate Bot reopened this Aug 30, 2026
@renovate
renovate Bot force-pushed the renovate/go-github.com-gofiber-fiber-v2-vulnerability branch 2 times, most recently from 61e74e7 to 82aebeb Compare August 30, 2026 12:49
@renovate renovate Bot changed the title fix(deps): update module github.com/gofiber/fiber/v2 to v2.52.14 [security] fix(deps): update module github.com/gofiber/fiber/v2 to v2.52.14 [security] - autoclosed Aug 31, 2026
@renovate renovate Bot closed this Aug 31, 2026
@renovate renovate Bot changed the title fix(deps): update module github.com/gofiber/fiber/v2 to v2.52.14 [security] - autoclosed fix(deps): update module github.com/gofiber/fiber/v2 to v2.52.14 [security] Aug 31, 2026
@renovate renovate Bot reopened this Aug 31, 2026
@renovate
renovate Bot force-pushed the renovate/go-github.com-gofiber-fiber-v2-vulnerability branch from 82aebeb to 281798c Compare August 31, 2026 22:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants