<?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://vulnerability.circl.lu</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>Tue, 29 Sep 2026 13:29:28 +0000</lastBuildDate>
    <item>
      <title>GHSA-mqqf-5wvp-8fh8 — chi has an open redirect vulnerability in the RedirectSlashes middleware</title>
      <link>https://vulnerability.circl.lu/vuln/ghsa-mqqf-5wvp-8fh8</link>
      <description>&lt;p&gt;&lt;strong&gt;Affected:&lt;/strong&gt; Go: github.com/go-chi/chi/v5&lt;/p&gt;
&lt;p&gt;### Summary&lt;/p&gt;
&lt;p&gt;The `RedirectSlashes` function in middleware/strip.go does not perform correct input validation and can lead to an open redirect vulnerability.&lt;/p&gt;
&lt;p&gt;### Details&lt;/p&gt;
&lt;p&gt;The `RedirectSlashes` function performs a `Trim` to all forward slash (`/`) characters, while prepending a single one at the begining of the path (Line 52).&lt;/p&gt;
&lt;p&gt;However, it does not trim backslashes (`\`).&lt;/p&gt;
&lt;p&gt;```go
File: middleware/strip.go
41: func RedirectSlashes(next http.Handler) http.Handler {
...
51: 			// Trim all leading and trailing slashes (e.g., &amp;#34;//evil.com&amp;#34;, &amp;#34;/some/path//&amp;#34;)
52: 			path = &amp;#34;/&amp;#34; + strings.Trim(path, &amp;#34;/&amp;#34;)
...
62: }
```&lt;/p&gt;
&lt;p&gt;Also, from version 5.2.2 onwards the `RedirectSlashes` function does not take into consideration the `Host` Header in the redirect response returned. This was done in order to combat another [[vulnerability](https://github.com/go-chi/chi/security/advisories/GHSA-vrw8-fxc6-2r93)](https://github.com/go-chi/chi/security/advisories/GHSA-vrw8-fxc6-2r93).&lt;/p&gt;
&lt;p&gt;The above make it possible for a response in the following form:&lt;/p&gt;
&lt;p&gt;```
HTTP/1.1 301 Moved Permanently
Location: /\evil.com
```&lt;/p&gt;
&lt;p&gt;The `/\evil.com` will be transformed by most browsers (Chrome, Firefox, etc. not Safari) into `//evil.com` which is a protocol relative URL and will result in a redirect to `evil.com`, essentially making it an open redirect vulnerability.&lt;/p&gt;
&lt;p&gt;### PoC&lt;/p&gt;
&lt;p&gt;A minimal working example can be seen below.&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;&lt;/p&gt;
&lt;p&gt;&amp;#34;github.com/go-chi/chi/v5&amp;#34;
	&amp;#34;github.com/go-chi/chi/v5/middle…&lt;/p&gt;</description>
      <content:encoded>&lt;p&gt;&lt;strong&gt;Affected:&lt;/strong&gt; Go: github.com/go-chi/chi/v5&lt;/p&gt;
&lt;p&gt;### Summary&lt;/p&gt;
&lt;p&gt;The `RedirectSlashes` function in middleware/strip.go does not perform correct input validation and can lead to an open redirect vulnerability.&lt;/p&gt;
&lt;p&gt;### Details&lt;/p&gt;
&lt;p&gt;The `RedirectSlashes` function performs a `Trim` to all forward slash (`/`) characters, while prepending a single one at the begining of the path (Line 52).&lt;/p&gt;
&lt;p&gt;However, it does not trim backslashes (`\`).&lt;/p&gt;
&lt;p&gt;```go
File: middleware/strip.go
41: func RedirectSlashes(next http.Handler) http.Handler {
...
51: 			// Trim all leading and trailing slashes (e.g., &amp;#34;//evil.com&amp;#34;, &amp;#34;/some/path//&amp;#34;)
52: 			path = &amp;#34;/&amp;#34; + strings.Trim(path, &amp;#34;/&amp;#34;)
...
62: }
```&lt;/p&gt;
&lt;p&gt;Also, from version 5.2.2 onwards the `RedirectSlashes` function does not take into consideration the `Host` Header in the redirect response returned. This was done in order to combat another [[vulnerability](https://github.com/go-chi/chi/security/advisories/GHSA-vrw8-fxc6-2r93)](https://github.com/go-chi/chi/security/advisories/GHSA-vrw8-fxc6-2r93).&lt;/p&gt;
&lt;p&gt;The above make it possible for a response in the following form:&lt;/p&gt;
&lt;p&gt;```
HTTP/1.1 301 Moved Permanently
Location: /\evil.com
```&lt;/p&gt;
&lt;p&gt;The `/\evil.com` will be transformed by most browsers (Chrome, Firefox, etc. not Safari) into `//evil.com` which is a protocol relative URL and will result in a redirect to `evil.com`, essentially making it an open redirect vulnerability.&lt;/p&gt;
&lt;p&gt;### PoC&lt;/p&gt;
&lt;p&gt;A minimal working example can be seen below.&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;&lt;/p&gt;
&lt;p&gt;&amp;#34;github.com/go-chi/chi/v5&amp;#34;
	&amp;#34;github.com/go-chi/chi/v5/middle…&lt;/p&gt;</content:encoded>
      <guid isPermaLink="false">https://vulnerability.circl.lu/vuln/ghsa-mqqf-5wvp-8fh8</guid>
    </item>
  </channel>
</rss>
