Disclosure summary
### Summary The RedirectSlashes function in middleware/strip.go is vulnerable to host header injection which leads to open redirect. We consider this a **lower-severity** open redirect, as it can't be exploited from browsers or email clients (requires manipulation of a Host header). ### Details The RedirectSlashes method uses the Host header to construct the redirectURL at this line https://github.com/go-chi/chi/blob/master/middleware/strip.go#L55 The Host header can be manipulated by a user to be any arbitrary host. This leads to open redirect when using the RedirectSlashes middleware ### PoC Create a simple server which uses the RedirectSlashes middleware ``` package main import ( "fmt" "net/http" "github.com/go-chi/chi/v5" "github.com/go-chi/chi/v5/middleware" // Import the middleware package ) func main() { // Create a new Chi router r := chi.NewRouter() // Use the built-in RedirectSlashes middleware r.Use(middleware.RedirectSlashes) // Use middleware.RedirectSlashes // Define a route handler r.Get("/", func(w http.ResponseWriter, r *http.Request) { // A simple response w.Write([]byte("Hello, World!")) }) // Start the server fmt.Println("Starting server on :8080") http.ListenAn
Source-specific records & product guidance
Sources retain their own attribution and scoring. Follow the original record to confirm affected versions, fixed releases, and configuration conditions.
GitHub Reviewed Security Advisories · GHSA-vrw8-fxc6-2r93
Open original source · Updated Oct 02, 2026
chi Allows Host Header Injection which Leads to Open Redirect in RedirectSlashes
Source severity: MEDIUM / 5.1
| Ecosystem | Package | Affected range | First patched |
|---|---|---|---|
| go | github.com/go-chi/chi/v5 | 5.2.2 |
Original records & references
- NIST NVD record
- CVE Program record
- github.com — Reviewed advisory
PUBLISHED 2025-06-20T12:37:47-04:00
MODIFIED 2026-10-02T19:17:46-04:00
INGESTED 2026-10-06T11:45:17-04:00