Skip to content

Bump Go dependencies and fix open code scanning alerts - #409

Merged
aojea merged 7 commits into
google:mainfrom
aojea:deps-and-security-fixes
Sep 15, 2026
Merged

aojea merged 7 commits into
google:mainfrom
aojea:deps-and-security-fixes

Conversation

@aojea

@aojea aojea commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

Aggregates the open dependabot PRs and fixes the open code scanning alerts that are worth fixing, grouped into reviewable commits.

Dependency bumps (one commit)

Supersedes and closes #397, #398, #399, #400, #401:

  • github.com/jackc/pgx/v5 v5.10.0 → v5.11.0
  • github.com/modelcontextprotocol/go-sdk v1.7.0 → v1.8.0
  • golang.org/x/net v0.58.0 → v0.59.0
  • golang.org/x/oauth2 v0.36.0 → v0.37.0
  • golang.org/x/time v0.15.0 → v0.16.0

The x/* bumps raise the go directive to 1.26.0 (matches CI's GO_VERSION: 1.26). The same x/net and x/time versions are applied to the cmd/nano-init module. Note: this needed the DirectorRewrite migration from #407 (now merged) to pass staticcheck under go 1.26.

Code scanning fixes

  • ci: least-privilege workflow token permissions — alerts 38–40: top-level read-only default in deploy.yaml; release.yml write grants moved from workflow level to the goreleaser job.
  • security: console cookies + sambox path — alerts 23, 29–32: the logout and OIDC state/verifier deletion cookies now carry HttpOnly/Secure/SameSite matching the cookies they clear; the sambox interceptor filename gets filepath.Base as defense in depth (isValidIdentifier already forbids separators).
  • identity: verified JWT claims — alert 22 (go/missing-jwt-signature-check): VerifyJWT keeps using ParseUnverified only to route iss/aud to the right provider, but now returns claims decoded from the signature-verified oidc.IDToken instead of the unverified pre-parse.
  • build: pinned dependencies — scorecard PinnedDependenciesID alerts: every Dockerfile base image pinned to its multi-arch index digest (dependabot docker coverage extended to tests/e2e/docker and development/examples, grouped, to keep digests fresh); kind pinned to v0.33.0 and kubectl to v1.37.0 in kind-mesh-e2e; PostCSS npm packages pinned in deploy-github-pages; protoc-gen-go pinned to the go.mod protobuf version.

Deliberately not fixed

  • Scorecard meta-alerts 86–90 (Fuzzing/SAST/CodeReview/CII/Vulnerabilities): process checks, not code-fixable here.
  • curl | bash in scripts/startup-script.sh (alert 83): scale-test VM bootstrap that intentionally installs the latest release.
  • Unpinned pip/npm installs inside dev-example and e2e-fixture images: hash-pinning adds churn without protecting anything that ships.

Validation

Aggregates dependabot PRs google#397, google#398, google#399, google#400, google#401:
- github.com/jackc/pgx/v5 v5.10.0 -> v5.11.0
- github.com/modelcontextprotocol/go-sdk v1.7.0 -> v1.8.0
- golang.org/x/net v0.58.0 -> v0.59.0
- golang.org/x/oauth2 v0.36.0 -> v0.37.0
- golang.org/x/time v0.15.0 -> v0.16.0

Also bumps the transitively pulled x/crypto, x/sync, x/sys, x/text,
x/mod, x/tools and applies the same x/net and x/time versions to the
cmd/nano-init module.
Fixes scorecard TokenPermissionsID alerts google#38, google#39, google#40: deploy.yaml
gets a top-level read-only default (jobs already declare their own),
and release.yml moves its contents/packages write grants from the
workflow level down to the goreleaser job.
Fixes CodeQL alerts google#29-google#32 and google#23:
- console: set HttpOnly/Secure/SameSite on the logout and OIDC
  state/verifier deletion cookies, matching the attributes of the
  cookies they clear.
- sambox: apply filepath.Base to the interceptor filename before
  joining. isValidIdentifier already forbids path separators, so this
  is defense in depth (and a sanitizer CodeQL recognizes).
Fixes CodeQL alert google#22 (go/missing-jwt-signature-check). VerifyJWT uses
ParseUnverified only to extract iss/aud and route to the right OIDC
provider before the real signature verification, but it then returned
the claims map from that unverified parse. Decode the claims from the
signature-verified oidc.IDToken instead so callers can never observe
claims that differ from what was actually signed.
Fixes the scorecard PinnedDependenciesID alerts that are worth fixing:
- Pin every Dockerfile base image to its multi-arch index digest
  (production Dockerfile.*, tests/e2e/docker and development/examples)
  and extend the dependabot docker ecosystem to those directories,
  grouped, so the digests keep getting refreshed.
- kind-mesh-e2e: pin kind to v0.33.0 and kubectl to v1.37.0 instead of
  @latest / stable.txt.
- deploy-github-pages: pin the PostCSS toolchain npm packages.
- gen-proto.sh: pin protoc-gen-go to the go.mod protobuf version.

Left as-is deliberately: the curl|bash in scripts/startup-script.sh
(scale-test VM bootstrap that intentionally installs the latest
release) and pip/npm installs inside dev-example and e2e-fixture
images, where hash-pinning adds churn without protecting anything
that ships.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request focuses on security hardening and dependency updates across the repository. Key changes include pinning Docker base images to specific SHA256 digests, updating Go dependencies, securing console session and OIDC cookies with HttpOnly, Secure, and SameSite attributes, and ensuring OIDC JWT claims are decoded from the verified token. Additionally, path traversal defense-in-depth was added to the gateway. The review feedback correctly notes a violation of the repository style guide due to the lack of regression and negative tests for these security fixes, and provides a code suggestion to make the verified claims declaration more idiomatic.

Comment thread internal/identity/oidc.go Outdated
zizmor's insufficient-cooldown audit (medium) fails the zizmor-output
job for every update entry without a cooldown. A 7-day cooldown also
gives upstream releases time to be yanked before we pick them up.
Review feedback on google#409: security fixes need a regression/negative
test.
- console: assert the logout deletion cookie carries HttpOnly/SameSite
  and a negative MaxAge (fails before the cookie hardening).
- identity: forge a token by swapping the payload under a valid
  signature and assert VerifyJWT rejects it returning no claims.
- identity: declare verifiedClaims idiomatically (var, nil map).
@aojea
aojea merged commit 4c8d93b into google:main Sep 15, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant