Repository navigation
Update module github.com/go-chi/chi/v5 to v5.4.0 [SECURITY] - #74
Open
renovate[bot] wants to merge 1 commit into
Open
renovate[bot] wants to merge 1 commit into
renovate[bot] wants to merge 1 commit into
Conversation
renovate
Bot
deleted the
renovate/go-github.com-go-chi-chi-v5-vulnerability
branch
August 10, 2026 08:33
renovate
Bot
force-pushed
the
renovate/go-github.com-go-chi-chi-v5-vulnerability
branch
2 times, most recently
from
August 10, 2026 15:56
f1f0c61 to
4207a99
Compare
|
❌ The last analysis has failed. |
renovate
Bot
force-pushed
the
renovate/go-github.com-go-chi-chi-v5-vulnerability
branch
2 times, most recently
from
August 29, 2026 12:53
4207a99 to
9dcbd89
Compare
renovate
Bot
force-pushed
the
renovate/go-github.com-go-chi-chi-v5-vulnerability
branch
from
August 29, 2026 21:45
9dcbd89 to
34a09a8
Compare
renovate
Bot
force-pushed
the
renovate/go-github.com-go-chi-chi-v5-vulnerability
branch
2 times, most recently
from
August 31, 2026 19:43
34a09a8 to
23eac11
Compare
renovate
Bot
force-pushed
the
renovate/go-github.com-go-chi-chi-v5-vulnerability
branch
2 times, most recently
from
September 2, 2026 01:40
23eac11 to
140eec3
Compare
renovate
Bot
force-pushed
the
renovate/go-github.com-go-chi-chi-v5-vulnerability
branch
2 times, most recently
from
September 3, 2026 05:04
140eec3 to
7e70390
Compare
renovate
Bot
force-pushed
the
renovate/go-github.com-go-chi-chi-v5-vulnerability
branch
from
October 28, 2026 23:59
7e70390 to
61e0ada
Compare
Contributor
Author
ℹ️ Artifact update noticeFile name: go.modIn order to perform the update(s) described in the table above, Renovate ran the
Details:
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



This PR contains the following updates:
v5.2.2→v5.4.0chi has an open redirect vulnerability in the RedirectSlashes middleware
CVE-2025-69725 / GHSA-mqqf-5wvp-8fh8
More information
Details
Summary
The
RedirectSlashesfunction in middleware/strip.go does not perform correct input validation and can lead to an open redirect vulnerability.Details
The
RedirectSlashesfunction performs aTrimto all forward slash (/) characters, while prepending a single one at the begining of the path (Line 52).However, it does not trim backslashes (
\).Also, from version 5.2.2 onwards the
RedirectSlashesfunction does not take into consideration theHostHeader in the redirect response returned. This was done in order to combat another [vulnerability](https://redirect.github.com/go-chi/chi/security/advisories/GHSA-vrw8-fxc6-2r93).The above make it possible for a response in the following form:
The
/\evil.comwill be transformed by most browsers (Chrome, Firefox, etc. not Safari) into//evil.comwhich is a protocol relative URL and will result in a redirect toevil.com, essentially making it an open redirect vulnerability.PoC
A minimal working example can be seen below.
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.comwithout any domain/Host information.This opened in a browser (Chrome, Firefox) will result in a transformation to

//evil.comwhich in turn will result in a redirect toevil.com.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)
Severity
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:N/A:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
chi: Client IP spoofing in ClientIPFromXFF via X-Forwarded-For
CVE-2026-114437 / GHSA-j6qf-3m9c-vwj3
More information
Details
Summary
ClientIPFromXFFskips anyX-Forwarded-Forentry in a configured trusted CIDR but never verifies that the direct TCP peer inhttp.Request.RemoteAddrbelongs to that CIDR. A client that can reach the Go server directly can therefore append a trusted-looking proxy address and choose the client IP returned bymiddleware.GetClientIP.The attack is remote and requires one unauthenticated HTTP request with no user interaction (AV:N/AC:L/PR:N/UI:N). It changes security decisions and exposes one protected handler within the same application (S:U/C:L/I:L); no availability loss was observed (A:N).
Preconditions: The application uses
ClientIPFromXFFand makes the origin server reachable by an anonymous client outside the configured trusted-proxy CIDRs. No victim interaction is required.GET /admindirectly to the origin with noX-Forwarded-Forheader.403 Forbiddenresponse and an empty derived client IP.X-Forwarded-For: 10.0.0.7, 198.51.100.42.200 OKandclient-ip="10.0.0.7". Expected: the untrusted direct peer prevents the forwarding chain from being accepted.Details
The vulnerable code is
ClientIPFromXFFinmiddleware/client_ip.go, lines 93-116 at the tested revision. It callswalkXFFwith only the attacker-controlled header, skips every entry that matches a trusted prefix, and stores the first remaining address:The function does not parse
r.RemoteAddrbefore this walk. Consequently, the configured CIDRs identify trusted strings insideX-Forwarded-For, but do not establish that the immediate sender is one of those trusted proxies.Proof of concept
Using Go 1.24 or later, create and run this minimal application against the tested revision:
The no-header control was rejected:
Adding the forged chain authorized the same direct client:
Impact
I made an anonymous direct connection from
127.0.0.1, supplied a header that ended in a different trusted-proxy CIDR, and caused the application to treat my client IP as the allowlisted10.0.0.7. This changed the authorization decision from403 Forbiddento200 OKfor the protected handler.Severity
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Release Notes
go-chi/chi (github.com/go-chi/chi/v5)
v5.4.0Compare Source
What's Changed
New Contributors
Full Changelog: go-chi/chi@v5.3.2...v5.4.0
v5.3.2Compare Source
What's Changed
middleware.NewCompressor(level, "/*")never worked and silently compressed nothing. Instead of turning it into a compress-everything catch-all (as proposed in #868 and #1121), we decided to reject both "/" and "/*" at construction and panic. Compressing every response wastes CPU on already-compressed types (zip, jpeg, png), which is why the middleware keeps a curated default list. Users should pass explicit content types.Full Changelog: go-chi/chi@v5.3.1...v5.3.2
v5.3.1Compare Source
What's Changed
New Contributors
Full Changelog: go-chi/chi@v5.3.0...v5.3.1
v5.3.0Compare Source
What's Changed
New Contributors
SECURITY: middleware.ClientIP, a replacement for middleware.RealIP
@VojtechVitek submitted PR #967, which introduces middleware.ClientIP — a replacement for middleware.RealIP that closes the three open spoofing advisories:
RemoteAddrresolution (convto)middleware.RealIP(Saku0512, Critical / 9.3)It also addresses issues outlined at:
middleware.RealIPis deprecated in this PR with pointers to the new API.The deprecation only adds a
// Deprecated:doc comment; the function keeps working for backward compatibility.Why a new middleware (not "fix RealIP in place")
RealIPhas two unfixable design choices: it mutatesr.RemoteAddr, and it tries to be a one-size-fits-all default by walking a hard-coded list of headers any client can supply. Per adam-p's "The perils of the 'real' client IP" (which calls chi out by name on this), there is no safe default — the user must pick their trust source explicitly.The new API
Four middlewares, two accessors. Pick exactly one middleware based on your
infrastructure, read the result with one of the two accessors:
Example usage:
And in your handler or downstream middleware:
Thanks to @adam-p, @c2h5oh, @rezmoss, @Saku0512, @convto, @Dirbaio, @jawnsy, @lrstanley, @mfridman, @n33pm, @pkieltyka for the prior discussions, detailed reviews, advisory reports, and test contributions that shaped this PR.
Full Changelog: go-chi/chi@v5.2.5...v5.3.0
v5.2.5Compare Source
What's Changed
New Contributors
Full Changelog: go-chi/chi@v5.2.3...v5.2.5
v5.2.4Compare Source
What's Changed
New Contributors
Full Changelog: go-chi/chi@v5.2.3...v5.2.4
v5.2.3Compare Source
What's Changed
New Contributors
Full Changelog: go-chi/chi@v5.2.2...v5.2.3
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.