Skip to content

fix(security): migrate go-jose to v4.1.6 (CVE-2026-116587) - #390

Merged
pysarenko-bohdan merged 1 commit into
release-3.6from
bohdanpysarenko/cfs-23509-cfs-23520-go-jose-v4
Nov 24, 2026
Merged

pysarenko-bohdan merged 1 commit into
release-3.6from
bohdanpysarenko/cfs-23509-cfs-23520-go-jose-v4

Conversation

@pysarenko-bohdan

Copy link
Copy Markdown

Fixes CFS-23509 (codefresh/workflow-controller), CFS-23520 (codefresh/argocli)

Motivation

CVE-2026-116587 / GHSA-mgcc-cww5-fp2q (High): go-jose does not bound the RSA JWK size before rsa.PrivateKey.Validate(). A jwk header embedded in any parsed JWS/JWE causes CPU exhaustion (DoS) before any signature or decryption check. In argo-server SSO mode this path is reachable without authentication: Authorize parses the client's Authorization header.

  • go-jose/v4: fixed in v4.1.6.
  • go-jose/v3: no fixed release exists (v3.0.5 is the latest and is affected), so the only fix is moving off v3.

Modifications

  • github.com/go-jose/go-jose/v3 v3.0.5 → github.com/go-jose/go-jose/v4 v4.1.6. The indirect v4.1.4 is also bumped.
  • github.com/coreos/go-oidc/v3 v3.9.0 → v3.10.0. This is the first release on go-jose v4; its diff is only that migration, and the ID-token signing-algorithm policy is unchanged.
  • server/auth/sso/sso.go: go-jose v4's jwt.ParseEncrypted refuses all asymmetric key algorithms. Authorize now uses jose.ParseEncryptedCompact with an explicit RSA-OAEP-256/A256GCM allowlist, then Decrypt and unmarshals the claims with go-jose's json package. This is what jwt.Claims() does internally. CompactSerialize() → Serialize() (renamed in v4).
  • The token format is unchanged, so existing SSO sessions stay valid and mixed-version pods work during a rolling upgrade.
  • Other files: import path only (v3 → v4), mostly tests.

Verification

  • go build ./..., go vet, gofmt, go mod verify, golangci-lint run ./server/auth/... (0 issues).
  • go test ./server/... ./workflow/creator/... ./workflow/util/...: 23 packages ok.
  • go version -m on the argo, workflow-controller and argoexec binaries: only go-jose/v4 v4.1.6 and go-oidc/v3 v3.10.0, no go-jose v3.
  • Temporary SSO tests (not committed):
    • a token issued by the old v3 code is accepted by the new Authorize
    • a token issued by the new code is accepted by the old v3 parsing code (rolling upgrade)
    • new round trip works
    • expired token, wrong issuer, wrong key, RSA-OAEP/A128GCM algorithms and garbage input are all rejected
    • a token whose header embeds a huge malicious RSA JWK is rejected in under 1 ms

🤖 Generated with Claude Code

… CFS-23520)

go-jose v3 has no fixed release for GHSA-mgcc-cww5-fp2q (unbounded RSA JWK
validation -> CPU DoS via a jwk header in any parsed JWS/JWE), so:

- github.com/go-jose/go-jose/v3 v3.0.5 -> github.com/go-jose/go-jose/v4 v4.1.6
- github.com/coreos/go-oidc/v3 v3.9.0 -> v3.10.0 (first release on go-jose v4)
- server/auth/sso: v4's jwt.ParseEncrypted refuses asymmetric key algorithms,
  so Authorize parses the token via the JWE API with an explicit
  RSA-OAEP-256/A256GCM allowlist. The token format is unchanged, so existing
  SSO sessions and mixed-version rolling upgrades keep working.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@pysarenko-bohdan
pysarenko-bohdan merged commit bd1a8a0 into release-3.6 Nov 24, 2026
23 of 25 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.

2 participants