<?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 14:07:31 +0000</lastBuildDate>
    <item>
      <title>GHSA-rjr7-jggh-pgcp — chi's RealIP Middleware allows IP spoofing via unvalidated X-Forwarded-For header</title>
      <link>https://cve.radiocsirt.org/vuln/ghsa-rjr7-jggh-pgcp</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
realip middleware in go-chi/chi trusts headers like x-forwarded-for without checking them, so attackers can fake their ip and bypass rate limits or access controls&lt;/p&gt;
&lt;p&gt;### Details&lt;/p&gt;
&lt;p&gt;the vuln is in middleware/realip.go , the realIP() function pulls IPs straight from client headers and replaces r.RemoteAddr without checking if the request came from a trusted proxy&lt;/p&gt;
&lt;p&gt;```go
func realIP(r *http.Request) string {
    var ip string
    if tcip := r.Header.Get(trueClientIP); tcip != &amp;#34;&amp;#34; {
        ip = tcip  // controlled by attacker
    } else if xrip := r.Header.Get(xRealIP); xrip != &amp;#34;&amp;#34; {
        ip = xrip  // controlled by attacker
    } else if xff := r.Header.Get(xForwardedFor); xff != &amp;#34;&amp;#34; {
        ip, _, _ = strings.Cut(xff, &amp;#34;,&amp;#34;)  // controlled by attacker
    }
    // ...
    return ip
}
```&lt;/p&gt;
&lt;p&gt;no trusted proxy cidr check in place, any client can send these headers&lt;/p&gt;
&lt;p&gt;### PoC&lt;/p&gt;
&lt;p&gt;create a server with chi and use realip middleware&lt;/p&gt;
&lt;p&gt;```go
package main&lt;/p&gt;
&lt;p&gt;import (
    &amp;#34;fmt&amp;#34;
    &amp;#34;net/http&amp;#34;
    &amp;#34;github.com/go-chi/chi/v5&amp;#34;
    &amp;#34;github.com/go-chi/chi/v5/middleware&amp;#34;
)&lt;/p&gt;
&lt;p&gt;func main() {
    r := chi.NewRouter()
    r.Use(middleware.RealIP)&lt;/p&gt;
&lt;p&gt;r.Get(&amp;#34;/admin&amp;#34;, func(w http.ResponseWriter, r *http.Request) {
        // ip-based access control got bypassed
        if r.RemoteAddr == &amp;#34;127.0.0.1&amp;#34; {
            w.Write([]byte(&amp;#34;SECRET ADMIN DATA&amp;#34;))
            return
        }
        http.Error(w, &amp;#34;Forbidden&amp;#34;, 403)
    })&lt;/p&gt;
&lt;p&gt;http.ListenAndServe(&amp;#34;:8080&amp;#34;, r)
}
```&lt;/p&gt;
&lt;p&gt;spoofed the ip to bypass access c…&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
realip middleware in go-chi/chi trusts headers like x-forwarded-for without checking them, so attackers can fake their ip and bypass rate limits or access controls&lt;/p&gt;
&lt;p&gt;### Details&lt;/p&gt;
&lt;p&gt;the vuln is in middleware/realip.go , the realIP() function pulls IPs straight from client headers and replaces r.RemoteAddr without checking if the request came from a trusted proxy&lt;/p&gt;
&lt;p&gt;```go
func realIP(r *http.Request) string {
    var ip string
    if tcip := r.Header.Get(trueClientIP); tcip != &amp;#34;&amp;#34; {
        ip = tcip  // controlled by attacker
    } else if xrip := r.Header.Get(xRealIP); xrip != &amp;#34;&amp;#34; {
        ip = xrip  // controlled by attacker
    } else if xff := r.Header.Get(xForwardedFor); xff != &amp;#34;&amp;#34; {
        ip, _, _ = strings.Cut(xff, &amp;#34;,&amp;#34;)  // controlled by attacker
    }
    // ...
    return ip
}
```&lt;/p&gt;
&lt;p&gt;no trusted proxy cidr check in place, any client can send these headers&lt;/p&gt;
&lt;p&gt;### PoC&lt;/p&gt;
&lt;p&gt;create a server with chi and use realip middleware&lt;/p&gt;
&lt;p&gt;```go
package main&lt;/p&gt;
&lt;p&gt;import (
    &amp;#34;fmt&amp;#34;
    &amp;#34;net/http&amp;#34;
    &amp;#34;github.com/go-chi/chi/v5&amp;#34;
    &amp;#34;github.com/go-chi/chi/v5/middleware&amp;#34;
)&lt;/p&gt;
&lt;p&gt;func main() {
    r := chi.NewRouter()
    r.Use(middleware.RealIP)&lt;/p&gt;
&lt;p&gt;r.Get(&amp;#34;/admin&amp;#34;, func(w http.ResponseWriter, r *http.Request) {
        // ip-based access control got bypassed
        if r.RemoteAddr == &amp;#34;127.0.0.1&amp;#34; {
            w.Write([]byte(&amp;#34;SECRET ADMIN DATA&amp;#34;))
            return
        }
        http.Error(w, &amp;#34;Forbidden&amp;#34;, 403)
    })&lt;/p&gt;
&lt;p&gt;http.ListenAndServe(&amp;#34;:8080&amp;#34;, r)
}
```&lt;/p&gt;
&lt;p&gt;spoofed the ip to bypass access c…&lt;/p&gt;</content:encoded>
      <guid isPermaLink="false">https://cve.radiocsirt.org/vuln/ghsa-rjr7-jggh-pgcp</guid>
    </item>
  </channel>
</rss>
