<?xml version='1.0' encoding='UTF-8'?>
<?xml-stylesheet href="/static/style.xsl" type="text/xsl"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0">
  <channel>
    <title>Most recent entries from all</title>
    <link>https://cve.radiocsirt.org</link>
    <description>Contains only the most 10 recent entries.</description>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <generator>python-feedgen</generator>
    <language>en</language>
    <lastBuildDate>Fri, 16 Oct 2026 15:02:52 +0000</lastBuildDate>
    <item>
      <title>GHSA-9g5q-2w5x-hmxf — chi Middleware Vulnerable to Potential IP Spoofing via `X-Forwarded-For` Header in `Request.RemoteAddr` Resolution</title>
      <link>https://cve.radiocsirt.org/vuln/ghsa-9g5q-2w5x-hmxf</link>
      <description>&lt;p&gt;&lt;strong&gt;Affected:&lt;/strong&gt; Go: github.com/go-chi/chi/middleware, Go: github.com/go-chi/chi/v2/middleware, Go: github.com/go-chi/chi/v3/middleware, Go: github.com/go-chi/chi/v4/middleware, Go: github.com/go-chi/chi/v5/middleware&lt;/p&gt;
&lt;p&gt;### Summary
The vulnerability allows the `Request.RemoteAddr` to be spoofed when determining the request source IP via the `X-Forwarded-For` header. This could result in misidentification of the request source and potentially compromise access control and logging integrity.&lt;/p&gt;
&lt;p&gt;### Details
Currently, the `RealIP()` implementation splits the `X-Forwarded-For` header by `,` and uses the first IP.
https://github.com/go-chi/chi/blob/v5.1.0/middleware/realip.go#L50-L54&lt;/p&gt;
&lt;p&gt;However, relying on the first IP in the `X-Forwarded-For` header is insecure because it can be manipulated by attackers to falsify the source IP.&lt;/p&gt;
&lt;p&gt;Malicious Case:
1. A malicious client sends a request with a forged IP in the X-Forwarded-For header: `X-Forwarded-For: &amp;lt;forged-ip&amp;gt;`
2. The proxy appends the actual client’s IP and forwards the request: `X-Forwarded-For: &amp;lt;forged-ip&amp;gt;,&amp;lt;client-ip&amp;gt;`
3. If the server always uses the first IP, it becomes vulnerable to IP spoofing.&lt;/p&gt;
&lt;p&gt;Ideally, the implementation should verify IPs starting from the end of the `X-Forwarded-For` header value, skipping trusted IPs within the system, and using the first untrusted IP as the actual client IP.&lt;/p&gt;
&lt;p&gt;For example, the `labstack/echo` web framework processes the `X-Forwarded-For` header by checking IPs from the end, skipping trusted IPs, and using the first untrusted IP as the client&amp;#39;s ip.
https://github.com/labstack/echo/blob/v4.13.2/ip.go#L261-L273&lt;/p&gt;
&lt;p&gt;### PoC
#### 1. Run the Go application with the following code:
```go
package main&lt;/p&gt;
&lt;p&gt;import (…&lt;/p&gt;</description>
      <content:encoded>&lt;p&gt;&lt;strong&gt;Affected:&lt;/strong&gt; Go: github.com/go-chi/chi/middleware, Go: github.com/go-chi/chi/v2/middleware, Go: github.com/go-chi/chi/v3/middleware, Go: github.com/go-chi/chi/v4/middleware, Go: github.com/go-chi/chi/v5/middleware&lt;/p&gt;
&lt;p&gt;### Summary
The vulnerability allows the `Request.RemoteAddr` to be spoofed when determining the request source IP via the `X-Forwarded-For` header. This could result in misidentification of the request source and potentially compromise access control and logging integrity.&lt;/p&gt;
&lt;p&gt;### Details
Currently, the `RealIP()` implementation splits the `X-Forwarded-For` header by `,` and uses the first IP.
https://github.com/go-chi/chi/blob/v5.1.0/middleware/realip.go#L50-L54&lt;/p&gt;
&lt;p&gt;However, relying on the first IP in the `X-Forwarded-For` header is insecure because it can be manipulated by attackers to falsify the source IP.&lt;/p&gt;
&lt;p&gt;Malicious Case:
1. A malicious client sends a request with a forged IP in the X-Forwarded-For header: `X-Forwarded-For: &amp;lt;forged-ip&amp;gt;`
2. The proxy appends the actual client’s IP and forwards the request: `X-Forwarded-For: &amp;lt;forged-ip&amp;gt;,&amp;lt;client-ip&amp;gt;`
3. If the server always uses the first IP, it becomes vulnerable to IP spoofing.&lt;/p&gt;
&lt;p&gt;Ideally, the implementation should verify IPs starting from the end of the `X-Forwarded-For` header value, skipping trusted IPs within the system, and using the first untrusted IP as the actual client IP.&lt;/p&gt;
&lt;p&gt;For example, the `labstack/echo` web framework processes the `X-Forwarded-For` header by checking IPs from the end, skipping trusted IPs, and using the first untrusted IP as the client&amp;#39;s ip.
https://github.com/labstack/echo/blob/v4.13.2/ip.go#L261-L273&lt;/p&gt;
&lt;p&gt;### PoC
#### 1. Run the Go application with the following code:
```go
package main&lt;/p&gt;
&lt;p&gt;import (…&lt;/p&gt;</content:encoded>
      <guid isPermaLink="false">https://cve.radiocsirt.org/vuln/ghsa-9g5q-2w5x-hmxf</guid>
    </item>
  </channel>
</rss>
