Repository navigation
Update module github.com/go-chi/chi/v5 to v5.4.0 [SECURITY] (release-v0.7) - #1936
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
|
🤖 Finished Review · ✅ Success · Started 9:02 AM UTC · Completed 9:11 AM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $2.30 |
|
<!-- fullsend:risk-assessment --> DetailsRoutine bot-driven security dependency update touching only go.mod and go.sum (6 lines); the elevated dependency-file signal remains the sole driver above minimum, while small size, bot authorship, and no protected or security-sensitive paths keep the composite at moderate — unchanged from prior assessment. Previous run<!-- fullsend:risk-assessment --> DetailsRoutine bot-driven security dependency update touching only go.mod and go.sum (6 lines); the elevated dependency-file signal is the sole driver above minimum, but small size, bot authorship, and no protected or security-sensitive paths keep the composite well within moderate territory. |
|
Looks good to me Previous run<!-- fullsend:review-findings-v2:eyJ2ZXJzaW9uIjoyLCJhY3Rpb24iOiJhcHByb3ZlIiwiZmluZGluZ3MiOltdfQ== --> Looks good to me Labels: Dependency update PR modifying Go module files |
94e6035 to
6b04672
Compare
|
🤖 Finished Review · ✅ Success · Started 10:23 PM UTC · Completed 10:33 PM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $2.77 |
Superseded by updated review
|
🤖 Finished Retro · ✅ Success · Started 3:39 PM UTC · Completed 3:50 PM UTC Commit: Runtime: claude · Model: opus → claude-opus-4-6 · Effort: high · Cost: $4.78 |
Retro: PR #1936 — Renovate go-chi/chi v5.4.0 security bump (release-v0.7)This PR was a Renovate bot security dependency update bumping Cost concern: $5.07 in review for a 6-line dependency bumpThe review agent ran twice on this PR:
The second review was unnecessary — the diff-to-base was identical after the rebase, and the prior review had approved with zero findings. The agent recognized the re-review scenario but still launched the full orchestration pipeline. Additionally, the same dependency bump was independently reviewed on sibling PRs targeting other branches: #1935 (main) and #1937 (release-v0.8). No new proposals — existing issues cover all findingsRe-review on rebase: This retro adds supporting evidence for fullsend-ai/fullsend#8830 and fullsend-ai/fullsend#4401 — both propose skipping re-review dispatch when a force-push/rebase produces an identical diff. This PR confirms the pattern persists, with a $2.77 wasted re-review on an unchanged diff. Lighter review for bot dependency PRs: This retro adds evidence for fullsend-ai/fullsend#8383 (route trivial bot dependency-bump PRs to lighter review config) and fullsend-ai/agents#257 (pre-review early exit for bot dependency-update PRs). Using opus at high effort for a 6-line go.mod/go.sum change is disproportionate — every sub-agent immediately early-exited. Cross-branch duplication: fullsend-ai/fullsend#4568 (cross-reference sibling PRs) is the nearest tracked issue. Three identical dependency bumps were independently reviewed across main, release-v0.7, and release-v0.8. Retro on bot PRs: This retro itself is a data point for fullsend-ai/agents#276 (skip retro on zero-involvement bot PRs). The workflow went well; the retro confirms known waste patterns without surfacing new issues. What went well
|
This PR contains the following updates:
v5.2.2→v5.4.0chi: 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 becomes conflicted, 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.