lint: fix gosec G703 path traversal finding in deploy log download handler #177
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Surveyed 2026-08-07: golangci-lint 2.12.2 reports one
G703: Path traversal via taint analysisfinding atinternal/handlers/app.go:629—http.ServeFilecalled with alogPathderived from request data:Remediation: before serving, canonicalize the path
(
filepath.Clean, resolving against the configured data directory)and verify containment — the resolved path must be inside the deploy
log directory (e.g.
filepath.Relresult must not start with..).Return 404 on violation. Do not use
//nolint.Definition of done:
make lint(golangci-lint ≥ 2.12) reports zeroG703findings(e.g. an id containing
..) and asserts it is rejectedmake testpasses)make fmtrun before commit;TODO.mdupdated per the repo workflowmain