Surveyed 2026-08-07: golangci-lint 2.12.2 reports 23 gosec findings
on main; 22 of them are G710: Open redirect via taint analysis, all
in internal/handlers/app.go (lines 289, 374, 400, 424, 429, 802, 835,
889, 899, 1034, 1062, 1075, 1091, 1120, 1148, 1169, 1215, 1277, 1290,
1326, 1334, 1348). The remaining G703 finding is tracked in its own
issue.
Every site has the same shape: http.Redirect with a URL built by
string concatenation from application.ID, which taint analysis
considers request-derived, e.g.:
App IDs are ULIDs. Remediation: add one small helper (e.g. redirectToApp(w, r, appID, query string)) that validates the ID is a
well-formed ULID (or applies url.PathEscape) before building the
relative URL, then convert all 22 sites to use it. This both satisfies
the taint analysis and makes the invariant explicit. Do not use //nolint — fix the code, per the README commit requirements.
Definition of done:
make lint (golangci-lint ≥ 2.12) reports zero G710 findings
no //nolint directives added
redirect behavior unchanged (make test passes; existing handler
tests still green)
make fmt run before commit; TODO.md updated per the repo workflow
lands via PR from a feature branch off main
Surveyed 2026-08-07: golangci-lint 2.12.2 reports 23 `gosec` findings
on `main`; 22 of them are `G710: Open redirect via taint analysis`, all
in `internal/handlers/app.go` (lines 289, 374, 400, 424, 429, 802, 835,
889, 899, 1034, 1062, 1075, 1091, 1120, 1148, 1169, 1215, 1277, 1290,
1326, 1334, 1348). The remaining `G703` finding is tracked in its own
issue.
Every site has the same shape: `http.Redirect` with a URL built by
string concatenation from `application.ID`, which taint analysis
considers request-derived, e.g.:
```go
redirectURL := "/apps/" + application.ID + "?success=updated"
http.Redirect(writer, request, redirectURL, http.StatusSeeOther)
```
App IDs are ULIDs. Remediation: add one small helper (e.g.
`redirectToApp(w, r, appID, query string)`) that validates the ID is a
well-formed ULID (or applies `url.PathEscape`) before building the
relative URL, then convert all 22 sites to use it. This both satisfies
the taint analysis and makes the invariant explicit. Do not use
`//nolint` — fix the code, per the README commit requirements.
Definition of done:
- `make lint` (golangci-lint ≥ 2.12) reports zero `G710` findings
- no `//nolint` directives added
- redirect behavior unchanged (`make test` passes; existing handler
tests still green)
- `make fmt` run before commit; `TODO.md` updated per the repo workflow
- lands via PR from a feature branch off `main`
clawbot
added this to the 1.1.0 milestone 2026-08-07 18:40:31 +02:00
Starting this now on branch fix-gosec-g710, stacked on fix-noctx-lint (PR #183) so the lint-count progression and the TODO.md rotation stay serial; the PR should merge after #183.
Definition of done for the PR:
one shared helper in internal/handlers that validates the app ID
before building the redirect target; all 22 G710 sites converted
to it
make lint (golangci-lint 2.12.2): zero G710 findings; total
drops 47 → 25 (remaining: 1 gosec G703 → #177, 24 goconst → #178)
no //nolint directives; redirect behavior unchanged; make test
green
Starting this now on branch `fix-gosec-g710`, stacked on
`fix-noctx-lint` (PR #183) so the lint-count progression and the
`TODO.md` rotation stay serial; the PR should merge after #183.
Definition of done for the PR:
- one shared helper in `internal/handlers` that validates the app ID
before building the redirect target; all 22 `G710` sites converted
to it
- `make lint` (golangci-lint 2.12.2): zero `G710` findings; total
drops 47 → 25 (remaining: 1 `gosec` G703 → #177, 24 `goconst` →
#178)
- no `//nolint` directives; redirect behavior unchanged; `make test`
green
- `make fmt` run; `TODO.md` Next Step rotated to #177
- before/after lint counts stated on the PR
Done in PR #186 (branch fix-gosec-g710, commit b580dbb, stacked on
PR #183): all 22 G710 findings resolved via a redirectToApp
helper (ulid.ParseStrict + re-serialize + url.PathEscape), make lint total 47 → 25, make test and make fmt-check green.
Awaiting independent review (labeled needs-review); merge after #183.
Done in PR #186 (branch `fix-gosec-g710`, commit b580dbb, stacked on
PR #183): all 22 `G710` findings resolved via a `redirectToApp`
helper (`ulid.ParseStrict` + re-serialize + `url.PathEscape`),
`make lint` total 47 → 25, `make test` and `make fmt-check` green.
Awaiting independent review (labeled needs-review); merge after #183.
Definition of done verified met on main (7a34fc9) — the fix landed
via #187 rather than PR #186, which is now closed as superseded:
all 22 G710 sites in internal/handlers/app.go now go through a redirectToApp helper that builds "/apps/" + url.PathEscape(appID) + suffix — a real sanitization
producing an always-relative application URL (url.PathEscape is
one of the two remediations this issue accepts)
no //nolint or #nosec directives added for these sites
make lint (pinned golangci-lint v2.12.2, canonical config): 0
findings, so zero G710
make check green in a clean worktree of main (tests with race
detector, lint, fmt-check); redirect behavior unchanged, handler
tests green
Closing.
Definition of done verified met on `main` (7a34fc9) — the fix landed
via #187 rather than PR #186, which is now closed as superseded:
- all 22 `G710` sites in `internal/handlers/app.go` now go through a
`redirectToApp` helper that builds
`"/apps/" + url.PathEscape(appID) + suffix` — a real sanitization
producing an always-relative application URL (`url.PathEscape` is
one of the two remediations this issue accepts)
- no `//nolint` or `#nosec` directives added for these sites
- `make lint` (pinned golangci-lint v2.12.2, canonical config): 0
findings, so zero `G710`
- `make check` green in a clean worktree of `main` (tests with race
detector, lint, `fmt-check`); redirect behavior unchanged, handler
tests green
Closing.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Surveyed 2026-08-07: golangci-lint 2.12.2 reports 23
gosecfindingson
main; 22 of them areG710: Open redirect via taint analysis, allin
internal/handlers/app.go(lines 289, 374, 400, 424, 429, 802, 835,889, 899, 1034, 1062, 1075, 1091, 1120, 1148, 1169, 1215, 1277, 1290,
1326, 1334, 1348). The remaining
G703finding is tracked in its ownissue.
Every site has the same shape:
http.Redirectwith a URL built bystring concatenation from
application.ID, which taint analysisconsiders request-derived, e.g.:
App IDs are ULIDs. Remediation: add one small helper (e.g.
redirectToApp(w, r, appID, query string)) that validates the ID is awell-formed ULID (or applies
url.PathEscape) before building therelative URL, then convert all 22 sites to use it. This both satisfies
the taint analysis and makes the invariant explicit. Do not use
//nolint— fix the code, per the README commit requirements.Definition of done:
make lint(golangci-lint ≥ 2.12) reports zeroG710findings//nolintdirectives addedmake testpasses; existing handlertests still green)
make fmtrun before commit;TODO.mdupdated per the repo workflowmainStarting this now on branch
fix-gosec-g710, stacked onfix-noctx-lint(PR #183) so the lint-count progression and theTODO.mdrotation stay serial; the PR should merge after #183.Definition of done for the PR:
internal/handlersthat validates the app IDbefore building the redirect target; all 22
G710sites convertedto it
make lint(golangci-lint 2.12.2): zeroG710findings; totaldrops 47 → 25 (remaining: 1
gosecG703 → #177, 24goconst→#178)
//nolintdirectives; redirect behavior unchanged;make testgreen
make fmtrun;TODO.mdNext Step rotated to #177Done in PR #186 (branch
fix-gosec-g710, commitb580dbb, stacked onPR #183): all 22
G710findings resolved via aredirectToApphelper (
ulid.ParseStrict+ re-serialize +url.PathEscape),make linttotal 47 → 25,make testandmake fmt-checkgreen.Awaiting independent review (labeled needs-review); merge after #183.
Definition of done verified met on
main(7a34fc9) — the fix landedvia #187 rather than PR #186, which is now closed as superseded:
G710sites ininternal/handlers/app.gonow go through aredirectToApphelper that builds"/apps/" + url.PathEscape(appID) + suffix— a real sanitizationproducing an always-relative application URL (
url.PathEscapeisone of the two remediations this issue accepts)
//nolintor#nosecdirectives added for these sitesmake lint(pinned golangci-lint v2.12.2, canonical config): 0findings, so zero
G710make checkgreen in a clean worktree ofmain(tests with racedetector, lint,
fmt-check); redirect behavior unchanged, handlertests green
Closing.
clawbot referenced this issue2026-09-03 18:29:27 +02:00