CVE-2025-69725: Github.com/go chi/chi/v5 Chi Has An Open Redirect Vulnerability

MODERATE
Advisory Identifier: GHSA-mqqf-5wvp-8fh8
CVSS 4.7
CWE-601
Published
Advisory Summary

CVE-2025-69725 is a MODERATE (CVSS 4.7) chi has an open redirect vulnerability (CWE-601: URL Redirection to Untrusted Site ('Open Redirect')) affecting Github.com/go chi/chi/v5 libraries in the Go ecosystem. The issue involves chi has an open redirect vulnerability in the redirectslashes middleware. Remediation is available by upgrading affected packages to version 5.2.4.

CVE-2025-69725 at a Glance

CVE Identifier CVE-2025-69725
GHSA Identifier GHSA-mqqf-5wvp-8fh8
Severity MODERATE
CVSS v3.1 Base Score 4.7
CWE Classification CWE-601: URL Redirection to Untrusted Site ('Open Redirect')
Affected Product Github.com/go chi/chi/v5
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 4.7

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Changed (S:C)
Confidentiality Low (C:L)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2025-69725

To remediate this vulnerability, upgrade all affected Github.com/go chi/chi/v5 dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/go-chi/chi/v5 fixed: 5.2.4
Upgrade github.com/go-chi/chi/v5 to 5.2.4
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/go-chi/chi/v5

How to Check if You Are Affected

To determine whether your application is affected by CVE-2025-69725, inspect your project dependencies for Github.com/go chi/chi/v5:

inspect dependencies for github.com/go-chi/chi/v5

Analyze the terminal output to locate any version of Github.com/go chi/chi/v5 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.2.4), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-601: URL Redirection to Untrusted Site ('Open Redirect'), where the web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a redirect. In Github.com/go chi/chi/v5, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary The `RedirectSlashes` function in middleware/strip.go does not perform correct input validation and can lead to an open redirect vulnerability. ### Details The `RedirectSlashes` function performs a `Trim` to all forward slash (`/`) characters, while prepending a single one at the begining of the path (Line 52). However, it does not trim backslashes (`\`). ```go File: middleware/strip.go 41: func RedirectSlashes(next http.Handler) http.Handler { ... 51: // Trim all leading and trailing slashes (e.g., "//evil.com", "/some/path//") 52: path = "/" + strings.Trim(path, "/") ... 62: } ``` 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). The above make it possible for a response in the following form: ``` HTTP/1.1 301 Moved Permanently Location: /\evil.com ``` 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. ### PoC A minimal working example can be seen below. ```go package main import ( "fmt" "net/http" "github.com/go-chi/chi/v5" "github.com/go-chi/chi/v5/middleware" ) func main() { r := chi.NewRouter() r.Use(middleware.RedirectSlashes) r.Get("/*", func(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusOK) }) fmt.Println("Server starting on port 8081...") if err := http.ListenAndServe(":8081", r); err != nil { fmt.Printf("Error starting server: %v\n", err) } } ``` And when we request the path `/\evil.com` (needs a second backslash or URL encoding in the terminal), the HTTP Redirect Location is just `/\evil.com` without any domain/Host information. ```bash $ curl -I localhost:8081/\\evil.com/ HTTP/1.1 301 Moved Permanently Content-Type: text/html; charset=utf-8 Location: /\evil.com ``` ```bash $ curl -I localhost:8081/%5Cevil.com/ HTTP/1.1 301 Moved Permanently Content-Type: text/html; charset=utf-8 Location: /\evil.com ``` This opened in a browser (Chrome, Firefox) will result in a transformation to `//evil.com` which in turn will result in a redirect to `evil.com`. <img width="200" alt="image-20250829115619807" src="https://github.com/user-attachments/assets/44aedad1-64b6-4660-8b26-fad9b4eca036" /> <img width="200" alt="image-20250829115632067" src="https://github.com/user-attachments/assets/b976d47d-1975-469c-abd3-deb907a68db2" /> ### Impact This essentially consists of an open redirect vulnerability, provided that victim users use the most popular browsers (Chrome, Firefox, etc. It does not work in e.g. Safari). The attacker can construct a malicious URL on a domain of a legitimate website and send it to the victim user. The victim users thinking that they will click on a legitimate website's URL, they will unknowingly be reidrected to an attacker controlled website. This can lead to credential theft if the victim gets redirected to a phishing website, to malware that is hosted on the attacker controlled website etc. Also, it has a greate reputation / business impact for the affected legitimate website. In order to exploit this vulnerability the attacker does not need to be authenticated or have ay other priviledge / knowledge regarding the affected application. CVSS Score: [4.7 (Medium)](https://www.first.org/cvss/calculator/3-0#CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:N/A:N)

CVE-2025-69725 Affected Github.com/go chi/chi/v5 Versions

1 component(s)
Fixed Versions:
5.2.4
Product / Package Ecosystem Affected Versions Fixed Version
github.com/go-chi/chi/v5
Go
≥ 5.2.2
< 5.2.4
5.2.4

References

Frequently Asked Questions

What is CVE-2025-69725?
CVE-2025-69725 is a security vulnerability in Github.com/go chi/chi/v5 involving chi has an open redirect vulnerability in the RedirectSlashes middleware under CWE-601: URL Redirection to Untrusted Site ('Open Redirect').
Which Github.com/go chi/chi/v5 versions are affected?
Affected versions include releases prior to 5.2.4 across affected packages: github.com/go-chi/chi/v5.
What version fixes CVE-2025-69725?
Upgrading to 5.2.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/go-chi/chi/v5 affected?
Yes, github.com/go-chi/chi/v5 is affected in releases prior to 5.2.4. Upgrade your dependency to 5.2.4 or later.
What is the CVSS score of CVE-2025-69725?
CVE-2025-69725 has a CVSS v3.1 base score of 4.7 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:N/A:N.
What CWE is associated with CVE-2025-69725?
CVE-2025-69725 is classified under CWE-601: URL Redirection to Untrusted Site ('Open Redirect') (The web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a redirect.).
How can I check Go dependencies for CVE-2025-69725?
Run the dependency tree command: 'inspect dependencies for github.com/go-chi/chi/v5'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-mqqf-5wvp-8fh8",
  "modified" : "2026-06-18T13:02:20Z",
  "published" : "2026-01-14T21:18:06Z",
  "aliases" : [ "CVE-2025-69725" ],
  "summary" : "chi has an open redirect vulnerability in the RedirectSlashes middleware",
  "details" : "### Summary\n\nThe `RedirectSlashes` function in middleware/strip.go does not perform correct input validation and can lead to an open redirect vulnerability.\n\n### Details\n\nThe `RedirectSlashes` function performs a `Trim` to all forward slash (`/`) characters, while prepending a single one at the begining of the path (Line 52).\n\nHowever, it does not trim backslashes (`\\`).\n\n```go\nFile: middleware/strip.go\n41: func RedirectSlashes(next http.Handler) http.Handler {\n...\n51: \t\t\t// Trim all leading and trailing slashes (e.g., \"//evil.com\", \"/some/path//\")\n52: \t\t\tpath = \"/\" + strings.Trim(path, \"/\")\n...\n62: }\n```\n\nAlso, 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).\n\nThe above make it possible for a response in the following form:\n\n```\nHTTP/1.1 301 Moved Permanently\nLocation: /\\evil.com\n```\n\nThe `/\\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.\n\n### PoC\n\nA minimal working example can be seen below.\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\n\t\"github.com/go-chi/chi/v5\"\n\t\"github.com/go-chi/chi/v5/middleware\"\n)\n\n\n\nfunc main() {\n\tr := chi.NewRouter()\n\n\tr.Use(middleware.RedirectSlashes)\n\n\tr.Get(\"/*\", func(w http.ResponseWriter, r *http.Request) {\n\t\tw.WriteHeader(http.StatusOK)\n\t})\n\n\tfmt.Println(\"Server starting on port 8081...\")\n\tif err := http.ListenAndServe(\":8081\", r); err != nil {\n\t\tfmt.Printf(\"Error starting server: %v\\n\", err)\n\t}\n}\n\n```\n\nAnd when we request the path `/\\evil.com` (needs a second backslash or URL encoding in the terminal), the HTTP Redirect Location is just `/\\evil.com` without any domain/Host information.\n\n```bash\n$ curl -I  localhost:8081/\\\\evil.com/\nHTTP/1.1 301 Moved Permanently\nContent-Type: text/html; charset=utf-8\nLocation: /\\evil.com\n```\n\n```bash\n$ curl -I  localhost:8081/%5Cevil.com/\nHTTP/1.1 301 Moved Permanently\nContent-Type: text/html; charset=utf-8\nLocation: /\\evil.com\n```\n\nThis opened in a browser (Chrome, Firefox) will result in a transformation to `//evil.com` which in turn will result in a redirect to `evil.com`.\n<img width=\"200\" alt=\"image-20250829115619807\" src=\"https://github.com/user-attachments/assets/44aedad1-64b6-4660-8b26-fad9b4eca036\" />\n\n\n<img width=\"200\" alt=\"image-20250829115632067\" src=\"https://github.com/user-attachments/assets/b976d47d-1975-469c-abd3-deb907a68db2\" />\n\n\n### Impact\n\nThis essentially consists of an open redirect vulnerability, provided that victim users use the most popular browsers (Chrome, Firefox, etc. It does not work in e.g. Safari).\n\nThe attacker can construct a malicious URL on a domain of a legitimate website and send it to the victim user. The victim users thinking that they will click on a legitimate website's URL, they will unknowingly be reidrected to an attacker controlled website.\n\nThis can lead to credential theft if the victim gets redirected to a phishing website, to malware that is hosted on the attacker controlled website etc. Also, it has a greate reputation / business impact for the affected legitimate website.\n\nIn order to exploit this vulnerability the attacker does not need to be authenticated or have ay other priviledge / knowledge regarding the affected application.\n\nCVSS Score: [4.7 (Medium)](https://www.first.org/cvss/calculator/3-0#CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:N/A:N)",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/go-chi/chi/v5"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.2.2"
      }, {
        "fixed" : "5.2.4"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/go-chi/chi/security/advisories/GHSA-mqqf-5wvp-8fh8"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-69725"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/go-chi/chi/issues/1037"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/go-chi/chi/commit/6eb35881c0e438ffb663ddbad3a61babaa5e5d8a"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/go-chi/chi"
  }, {
    "type" : "WEB",
    "url" : "http://go-chichi.com"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-601" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-01-14T21:18:06Z",
    "nvd_published_at" : null
  }
}