---
id: CVE-2026-72817
title: >-
  go-chi/chi versions 0.9.0 before 5.3.0 contains an IP spoofing vulnerability
  in the RealIP middleware, which resolves the request source IP
  (Request.RemoteAddr) using the first IP in the X-Forwarded-For header without
  validating trusted …
summary: >-
  go-chi/chi versions 0.9.0 before 5.3.0 contains an IP spoofing vulnerability
  in the RealIP middleware, which resolves the request source IP
  (Request.RemoteAddr) using the first IP in the X-Forwarded-For header without
  validating trusted …
severity: medium
cvss: 6.5
cvssVector: 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N'
cwe:
  - CWE-345
vendor: go-chi
product: github.com/go-chi/chi/middleware
affected:
  - 'github.com/go-chi/chi/middleware >= 0.9.0, <= 1.5.5'
  - github.com/go-chi/chi/v2/middleware <= 2.1.1
  - github.com/go-chi/chi/v3/middleware <= 3.3.5
  - github.com/go-chi/chi/v4/middleware <= 4.1.3
  - github.com/go-chi/chi/v5/middleware < 5.3.0
patched:
  - github.com/go-chi/chi/v5/middleware 5.3.0
published: '2026-08-14'
updated: '2026-09-09'
sourceUpdated: '2026-09-09T20:35:08.537'
source: NVD
sourceUrl: 'https://nvd.nist.gov/vuln/detail/CVE-2026-72817'
references:
  - url: 'https://github.com/go-chi/chi/security/advisories/GHSA-9g5q-2w5x-hmxf'
    label: disclosure@vulncheck.com
  - url: >-
      https://www.vulncheck.com/advisories/go-chi-chi-before-ip-spoofing-via-x-forwarded-for
    label: disclosure@vulncheck.com
  - url: 'https://github.com/go-chi/chi'
  - url: 'https://github.com/go-chi/chi/releases/tag/v5.3.0'
tags:
  - nvd
  - osv
  - go
epss: 0.00242
epssPercentile: 0.13695
aliases:
  - GHSA-9g5q-2w5x-hmxf
  - GO-2026-5775
ecosystem: go
ingestedAt: '2026-08-15T19:19:53.710Z'
---

## Overview

go-chi/chi versions 0.9.0 before 5.3.0 contains an IP spoofing vulnerability in the RealIP middleware, which resolves the request source IP (Request.RemoteAddr) using the first IP in the X-Forwarded-For header without validating trusted proxies. A malicious client can prepend a forged IP as the first value of the X-Forwarded-For header to spoof the request source IP, potentially bypassing access controls or falsifying request logs.

## Remediation

Refer to the linked advisories for vendor-supplied fixes and affected version ranges.

## Package advisory (CVE-2026-72817)

Affected packages:

- `github.com/go-chi/chi/middleware >= 0.9.0, <= 1.5.5`
- `github.com/go-chi/chi/v2/middleware <= 2.1.1`
- `github.com/go-chi/chi/v3/middleware <= 3.3.5`
- `github.com/go-chi/chi/v4/middleware <= 4.1.3`
- `github.com/go-chi/chi/v5/middleware < 5.3.0`

Patched in:

- `github.com/go-chi/chi/v5/middleware 5.3.0`

Source: https://osv.dev/vulnerability/GHSA-9g5q-2w5x-hmxf
