Advisory Database
  • Advisories
  • Dependency Scanning
  1. golang
  2. ›
  3. github.com/go-chi/chi/v5/middleware
  4. ›
  5. GHSA-3fxj-6jh8-hvhx

GHSA-3fxj-6jh8-hvhx: chi Has an IP Spoofing Vulnerability in `middleware.RealIP`

June 25, 2026

The RealIP middleware in go-chi/chi is vulnerable to IP spoofing because it blindly trusts the first (leftmost) element of the X-Forwarded-For HTTP header. This allows a remote attacker to bypass IP-based access control lists (ACLs) and rate-limiting mechanisms by providing a spoofed IP address in the header.

References

  • github.com/advisories/GHSA-3fxj-6jh8-hvhx
  • github.com/go-chi/chi/security/advisories/GHSA-3fxj-6jh8-hvhx

Code Behaviors & Features

Detect and mitigate GHSA-3fxj-6jh8-hvhx with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions starting from 5.2.1 before 5.3.0

Fixed versions

  • 5.3.0

Solution

Upgrade to version 5.3.0 or above.

Impact 6.5 MEDIUM

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N

Learn more about CVSS

Weakness

  • CWE-290: Authentication Bypass by Spoofing
  • CWE-345: Insufficient Verification of Data Authenticity

Source file

go/github.com/go-chi/chi/v5/middleware/GHSA-3fxj-6jh8-hvhx.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Thu, 16 Jul 2026 00:20:57 +0000.