Fix CI lint failures (gosec G710) and bump dependencies#258
Merged
Conversation
golangci-lint's latest release added gosec rule G710 (open redirect via taint analysis), which broke the "Testing push" workflow on master and on every dependabot branch. Two of the three findings were legitimate: a request path starting with "//" would produce a scheme-relative Location header, redirecting to another host. Fix by collapsing duplicate leading slashes before redirecting, and suppress the remaining intentional case (operator-configured redirect rules may target external URLs by design). Also: - Bump github.com/yuin/goldmark 1.8.2 -> 1.8.4 - Bump golang.org/x/crypto 0.49.0 -> 0.52.0 - Bump github.com/go-chi/chi/v5 5.2.5 -> 5.3.1 - Bump github.com/klauspost/compress 1.18.6 -> 1.19.0 - Bump github.com/go-playground/validator/v10 10.30.2 -> 10.30.3 - Bump actions/checkout v6 -> v7 in all workflows - Migrate gomodguard -> gomodguard_v2 (deprecation warning) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Why
The
Testing pushworkflow usesgolangci-lint@latest, and a recent golangci-lint release (2.12.x) added gosec rule G710: open redirect via taint analysis. This broke CI on master (since #249) and on every dependabot branch, which is why all the dependency PRs are blocked.What
Lint/security fixes — G710 flagged three
http.Redirectcalls; two were legitimately exploitable (a request path starting with//yields a scheme-relativeLocationheader, e.g.GET //evil.com/index.html→ redirect to//evil.com/):internal/middlewares/redir_indexes.goandinternal/server/handlers.go: collapse duplicate leading slashes before redirecting so the target is always same-origin, then suppress the now-false-positive with justification.internal/redirects/redirect.go: placeholder expansion (e.g.:splat) could also turn a local rule destination into//host; same leading-slash collapse applied. The redirect call itself is suppressed with justification since operator-configured rules may intentionally target external URLs.gomodguard→gomodguard_v2(deprecation warning).Dependency bumps — supersedes the blocked dependabot PRs #251, #252, #254, #255, #256, #257:
Verification
golangci-lint run(2.12.2, same as CI): 0 issuesgo test ./...: all packages pass🤖 Generated with Claude Code