From 5b234b3c39f1791435d0c601ed8cb3605817d0c1 Mon Sep 17 00:00:00 2001 From: JonasBorgesLM Date: Thu, 8 Oct 2026 21:24:25 -0300 Subject: [PATCH] build(deps): move Go to 1.26.9 for GO-2026-6617 GO-2026-6617 (CVE-2026-97032, an HTTP/2 server crash in net/http) affects every release before 1.26.9 and 1.27.0-1.27.1. go.mod and both images were on 1.26.6; CI reads the version from go.mod, so build, tests and images now all run on 1.26.9. 1.27.2 would exclude both lines' vulnerable releases, but no staticcheck release (nor go-tools master) reads Go 1.27 export data yet, nor does gosec v2.28.0, so it would cost the whole lint gate. The residual (a local 1.27.0/1.27.1 build satisfies the floor) and the reopening condition are recorded in docs/DECISIONS.md. Closes #312 Co-Authored-By: Claude Opus 5.5 --- Dockerfile | 2 +- README.md | 2 +- docs/DECISIONS.md | 35 +++++++++++++++++++++++++++++++++++ go.mod | 2 +- web/Dockerfile | 2 +- 5 files changed, 39 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 43133bb..b35cd35 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,7 +8,7 @@ ## toolchain, module cache, or source tree — is present in the final ## image; only the compiled binary is copied out of it below. ## --------------------------------------------------------------------- -FROM golang:1.26.6-alpine AS builder +FROM golang:1.26.9-alpine AS builder WORKDIR /src diff --git a/README.md b/README.md index 3ae6352..923cd44 100644 --- a/README.md +++ b/README.md @@ -112,7 +112,7 @@ make build && ./bin/task-api # build a standalone binary ## Running with Docker -`Dockerfile` is a two-stage build: `golang:1.26.6-alpine` compiles a static (`CGO_ENABLED=0`) binary, copied into an empty `scratch` image — no shell, no libc, just the binary and a nonroot user. +`Dockerfile` is a two-stage build: `golang:1.26.9-alpine` compiles a static (`CGO_ENABLED=0`) binary, copied into an empty `scratch` image — no shell, no libc, just the binary and a nonroot user. ```bash make docker-build # build the image diff --git a/docs/DECISIONS.md b/docs/DECISIONS.md index 768361d..0d3abd5 100644 --- a/docs/DECISIONS.md +++ b/docs/DECISIONS.md @@ -3171,3 +3171,38 @@ MinIO), decisão de shape que fica para quando alguém depender de um e compila a MinIO inteira (~140MB de binário, dezenas de dependências) — mais lento que um `docker pull` de imagem pronta seria, se existisse uma. Builds seguintes reaproveitam o cache do Go que `actions/setup-go` já mantém. + +## Go 1.26.9, não 1.27.2, para a GO-2026-6617 (issue #312) + +A GO-2026-6617 / CVE-2026-97032 (crash de servidor HTTP/2 no `net/http`, +publicada em 2026-10-08) afeta a stdlib **< 1.26.9** e **1.27.0–1.27.1**. +`go.mod` e as duas imagens (`Dockerfile`, `web/Dockerfile`) passam de 1.26.6 +para **1.26.9**. Como a CI lê a versão do `go.mod` (`go-version-file`), o +build, os testes e as imagens rodam exatamente nela. + +**A opção não tomada: 1.27.2.** É a única versão que exclui as duas linhas +vulneráveis — um piso de 1.26.9 ainda é satisfeito por 1.27.0/1.27.1, que não +têm correção, e foi por isso que o `usher` subiu para 1.27.2 (usher#139). +Aqui ela custaria o gate de lint inteiro: nenhuma release do `staticcheck` +(v0.8.1 é a última) nem o `master` do go-tools leem o export data do Go 1.27 +("export data version 5 is greater than maximum supported version 4"), e o +`gosec` v2.28.0 também não. Em 1.26.9, os quatro gates — `staticcheck` (com e +sem `-tags=integration`), `gosec`, `govulncheck` e `go test -race` — passam +sem mudança, com o código de saída conferido. + +**Resíduo aceito:** alguém compilando localmente com Go 1.27.0 ou 1.27.1 +satisfaz o piso e gera um binário vulnerável. Os artefatos que este repositório +de fato produz (imagens e CI) não. Reabrir quando o `staticcheck` suportar Go +1.27: aí o piso vai para 1.27.2. + +**Exposição:** baixa. Nenhum dos binários serve TLS nem h2c (o `tls.Config` +em `cmd/api/main.go` é de cliente), e o `net/http` só fala HTTP/2 sobre TLS +por padrão. + +**Visto de passagem, para quando o gosec subir:** o `gosec` do `master` +(`d2b649e`) aponta G703 (path traversal por taint) em `cmd/web/main.go`, no +`os.Stat(fsPath)` do `spaHandler`. É falso positivo: o caminho passa por +`path.Clean` sobre um path enraizado e por `pathEscapesDir`, como o comentário +da função e `TestSPAHandler_PathTraversal_AttemptStillResolvesInsideDist` já +documentam. Vai precisar de um `#nosec G703` com essa justificativa quando a +versão do gosec for atualizada. diff --git a/go.mod b/go.mod index b29e91b..9ec3098 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/JonasBorgesLM/task-api -go 1.26.6 +go 1.26.9 require ( github.com/JonasBorgesLM/bastion v0.2.1 diff --git a/web/Dockerfile b/web/Dockerfile index 0979627..616665f 100644 --- a/web/Dockerfile +++ b/web/Dockerfile @@ -47,7 +47,7 @@ RUN npm run build ## server either serves the files in /dist or it does not, and that is ## already visible from what index.html itself renders. ## --------------------------------------------------------------------- -FROM golang:1.26.6-alpine AS go-builder +FROM golang:1.26.9-alpine AS go-builder WORKDIR /src