Skip to content

Commit 1cf8725

Browse files
Copilotnddq
andauthored
fix(deps): remove vulnerable chi v4 middleware dependency (#2651)
# Description `pkg/server` and `pkg/log` imported the chi v4 `middleware` package while `go.mod` already requires `chi/v5` for the router — a mixed-version leftover. The v4 line carries `GO-2026-4316` (open redirect in `RedirectSlashes`) with no fixed v4 release, and govulncheck flags it as reachable. This migrates both imports to `github.com/go-chi/chi/v5/middleware` and drops the v4 module from `go.mod`/`go.sum`. The v5 `middleware` API is drop-in for everything used. ## Related Issue Code-scanning alert 808 (govulncheck, `GO-2026-4316`), raised by the scanner added in #2643. ## Checklist - [ ] I have read the [contributing documentation](https://retina.sh/docs/Contributing/overview). - [ ] I signed and signed-off the commits (`git commit -S -s ...`). See [this documentation](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification) on signing commits. - [x] I have correctly attributed the author(s) of the code. - [x] I have tested the changes locally. - [x] I have followed the project's style guidelines. - [ ] I have updated the documentation, if necessary. - [ ] I have added tests, if applicable. ## Screenshots (if applicable) or Testing Completed Verified on the PR head: no `go-chi/chi` v4 reference remains anywhere in the repo, and `go build` and `go vet` pass for `pkg/server` and `pkg/log`. govulncheck at the builder toolchain (`go1.26.5`) confirms `GO-2026-4316` no longer appears. ## Additional Notes The govulncheck legs on this PR will still be red with 11 findings — that is unrelated to this change. Go 1.26.6 shipped stdlib security fixes on 2026-08-13 and the builder images are on `1.26.5`, so seven new stdlib findings apply repo-wide until the `golang-base` image bump. This PR's delta is exactly the removal of `GO-2026-4316`. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: nddq <28567936+nddq@users.noreply.github.com>
1 parent c3421f2 commit 1cf8725

4 files changed

Lines changed: 2 additions & 5 deletions

File tree

go.mod

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,6 @@ require (
182182
)
183183

184184
require (
185-
github.com/go-chi/chi v4.1.2+incompatible
186185
github.com/go-logr/logr v1.4.4
187186
github.com/gogo/protobuf v1.3.2 // indirect
188187
github.com/golang/protobuf v1.5.4 // indirect

go.sum

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -408,8 +408,6 @@ github.com/gkampitakis/go-diff v1.3.2 h1:Qyn0J9XJSDTgnsgHRdz9Zp24RaJeKMUHg2+PDZZ
408408
github.com/gkampitakis/go-diff v1.3.2/go.mod h1:LLgOrpqleQe26cte8s36HTWcTmMEur6OPYerdAAS9tk=
409409
github.com/gkampitakis/go-snaps v0.5.15 h1:amyJrvM1D33cPHwVrjo9jQxX8g/7E2wYdZ+01KS3zGE=
410410
github.com/gkampitakis/go-snaps v0.5.15/go.mod h1:HNpx/9GoKisdhw9AFOBT1N7DBs9DiHo/hGheFGBZ+mc=
411-
github.com/go-chi/chi v4.1.2+incompatible h1:fGFk2Gmi/YKXk0OmGfBh0WgmN3XB8lVnEyNz34tQRec=
412-
github.com/go-chi/chi v4.1.2+incompatible/go.mod h1:eB3wogJHnLi3x/kFX2A+IbTBlXxmMeXJVKy9tTv1XzQ=
413411
github.com/go-chi/chi/v5 v5.3.1 h1:3j4HZLGZQ3JpMCrPJF/Jl3mYJfWLKBfNJ6quurUGCf8=
414412
github.com/go-chi/chi/v5 v5.3.1/go.mod h1:R+tYY2hNuVUUjxoPtqUdgBqevM9s9njzkTLutVsOCto=
415413
github.com/go-critic/go-critic v0.14.3 h1:5R1qH2iFeo4I/RJU8vTezdqs08Egi4u5p6vOESA0pog=

pkg/log/zap.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
"time"
1414

1515
"github.com/Azure/azure-container-networking/zapai"
16-
"github.com/go-chi/chi/middleware"
16+
"github.com/go-chi/chi/v5/middleware"
1717
"github.com/go-logr/logr"
1818
"github.com/go-logr/zapr"
1919
logfmt "github.com/jsternberg/zap-logfmt"

pkg/server/server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import (
88
"net/http/pprof"
99
"time"
1010

11-
"github.com/go-chi/chi/middleware"
1211
"github.com/go-chi/chi/v5"
12+
"github.com/go-chi/chi/v5/middleware"
1313
"github.com/microsoft/retina/pkg/exporter"
1414
"github.com/microsoft/retina/pkg/log"
1515
"github.com/pkg/errors"

0 commit comments

Comments
 (0)