Skip to content

chore: clear the nightly CVE scan findings (go-jose, x/net, Go 1.27.4, klauspost, otel) - #9894

Open
shiva-istari wants to merge 4 commits into
mainfrom
shiva/bump-cve-deps
Open

shiva-istari wants to merge 4 commits into
mainfrom
shiva/bump-cve-deps

Conversation

@shiva-istari

@shiva-istari shiva-istari commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Fixes the failing ci-dgraph-nightly-cves scan on main (run 44207590663). Trivy flagged 2 HIGH in usr/local/bin/dgraph; the ubuntu 24.04 base layer had none.

Supersedes #9881, #9890 and #9891 — between them they leave golang.org/x/net unfixed, so merging all three still leaves the scan red.

  • chore(deps) — go-jose/v4 4.1.4 → 4.1.9 (CVE-2026-116587, GHSA-mgcc-cww5-fp2q: jwk.go hands RSA moduli to rsa.PrivateKey.Validate(), cubic on Go 1.24+; graphql/authorization unmarshals every key served by the configured JWK URLs). 4.1.9 rather than chore(deps): bump github.com/go-jose/go-jose/v4 from 4.1.4 to 4.1.6 #9881's 4.1.6 because 4.1.7 carries five more upstream fixes whose advisories record no patched version, so no scanner can see them. golang.org/x/net 0.60.0 → 0.63.0 (CVE-2026-78661, two DoS bugs in x/net/html — not imported anywhere in the tree, gating the scan only). The x/net bump pulls crypto, mod, sync, sys, term, text and tools forward.
  • chore(deps) — Go 1.27.3 → 1.27.4 and klauspost/compress 1.18.7 → 1.20.4, the two findings govulncheck reports as linked into the binary (GO-2026-6859 net/http MaxBytesReader crash; GO-2026-6865 fse/huff0 panic, reached via Badger's zstd). Neither is HIGH in Trivy today. go directive, not a toolchain line, for the reason given in chore: clear the nightly CVE scan findings (VEX re-key, x/net, Go 1.27.3) #9864; root Dockerfile builder moves to golang:1.27.4.
  • chore(deps) — otel sdk and trace 1.45.0 → 1.47.0 (CVE-2026-128085). go.mod change is identical to chore(deps): bump go.opentelemetry.io/otel/sdk from 1.45.0 to 1.47.0 #9890/chore(deps): bump go.opentelemetry.io/otel/trace from 1.45.0 to 1.47.0 #9891.
  • fix(graphql) — go-jose 4.1.6 caps JWK RSA moduli at 4096 bits. FetchJWK returned on the first unparseable key, FetchJWKs on the first failing URL, and NewHandler on that — so one oversized key in one JWKS stopped the GraphQL schema loading at all, including on restart after upgrade. Unparseable keys are now skipped and logged with their kid; verification looks keys up by kid, so a token signed by a skipped key fails with Invalid kid instead of taking the rest of the set down. A set where no key is usable is still an error.

Validation

  • Trivy against the rebuilt binary at usr/local/bin/dgraph with TRIVY_VEX=openvex.json: 2 HIGH before, 0 after — and 0 at MEDIUM too. govulncheck -mode=binary: no vulnerabilities found (only mcp-go GO-2026-6911 remains, uncalled, no fix available).
  • Upgrade and rollback on a live cluster. Old binary wrote 20k nodes across exact/term/fulltext/trigram/hash/int/float/datetime/geo/@reverse/@count, with lang-tagged values in de/ru/tr/sv/cs/en, under --badger compression=zstd:3. New binary opened that data: 4/4 query sets byte-identical. New binary wrote 10k more; old binary then reopened it and read everything, with pre-existing rows in unchanged collation order. Both binaries agree on all 5 query sets over the final data.
  • No reindex. collate.KeyFromString output — persisted as the index token for @index(exact) on @lang predicates — is byte-identical across x/text 0.42 → 0.44 for 740 keys over 20 languages.
  • blake2b digests identical and bcrypt hashes cross-verify across x/crypto 0.57 → 0.59, so ACL passwords survive. zstd and s2 payloads round-trip in both directions across klauspost 1.18.7 ↔ 1.20.4; 4KB-block throughput improves 21–35% on encode/decode with s2 decode unchanged.
  • The JWK cap was measured against dgraph's own fetch loop: 2048 and 4096 keys parse, >4096 fails. Nine public IdP JWKS endpoints (Google, Microsoft, Apple, Auth0, Firebase, Salesforce, GitHub Actions, GitLab, Okta) publish only 2048- or 4096-bit RSA keys, so no mainstream provider is affected. 4 tests added in graphql/authorization/auth_test.go; the two behavioural ones fail without the auth.go change.
  • go build ./... clean and 13 unit packages pass. systest and e2e need the CI harness — note systest was red on main from Oct 28 to Nov 16, so compare against a recent green main.

Suggested release note:

▎ GraphQL Dgraph.Authorization with JWKUrl: RSA keys larger than 4096 bits are no longer accepted from a JWK set (part of the fix for CVE-2026-116587). Such a key is skipped with a warning rather than failing the schema load; tokens signed by it are rejected.

Once this lands, a workflow_dispatch run of ci-dgraph-nightly-cves should confirm the scan is green.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Summary by CodeRabbit

  • Bug Fixes
    • Authentication key fetching now skips malformed keys while retaining valid ones. It reports an error when a non-empty key set contains no usable keys, and accepts empty key sets.
  • Chores
    • Updated the Go version and dependencies.

@shiva-istari
shiva-istari requested a review from a team as a code owner November 19, 2026 09:01
@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Explain Change →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Files ignored due to path filters: 1

  • go.sum is excluded by !**/*.sum
Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 88846290-c64e-484e-a923-bbbdfc9636b6
Commits

Reviewing files that changed from the base of the PR and between 6bd5e85 and 5223cbf.

Files ignored due to path filters: 1

  • go.sum is excluded by !**/*.sum

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

The Go toolchain and dependencies are updated. JWKS fetching now skips unparseable keys, retains usable keys, and returns an error when a non-empty key set has no usable keys.

Changes: Go updates and JWKS key handling

Layer / File(s) Summary
Update Go toolchain and dependencies
Dockerfile, go.mod
The Docker builder image and module Go version change to Go 1.27.4. The module dependency versions are updated.
Skip unparseable JWKS keys
graphql/authorization/auth.go, graphql/authorization/auth_test.go
FetchJWK skips keys that fail parsing and logs their IDs and errors. It returns an error when a non-empty set has no usable keys. Tests cover mixed, oversized, supported-size, and empty key sets.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Other

Suggested labels: dependencies, go, area/graphql

Suggested reviewers: matthewmcneely, minhaj-shakeel

Merge Risk: Minimal · previous review 6bd5e

This updates the Go version and dependencies to clear CVE scan findings and makes GraphQL JWKS loading tolerate one unusable key. No concrete merge-blocking risk was found. Confirm the nightly CVE scan run and CI before merging.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the change type (chore) and lists the components touched: go-jose, x/net, Go 1.27.4, klauspost, and otel. The changeset matches these items. The Dockerfile and go.mod bump Go, the go.m…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the change type (chore) and lists the components touched: go-jose, x/net, Go 1.27.4, klauspost, and otel. The changeset matches these items. The Dockerfile and go.mod bump Go, the go.mod diff updates go-jose, x/net, klauspost, and otel, and auth.go changes FetchJWK to handle go-jose parse failures. The title does not mention the GraphQL JWK handling change, which is a behavioral fix. It also lists many dependencies, which makes it noisy, but it still describes the primary intent of the dependency and CVE-clearing work.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 06676229-8ec4-49bb-bc3e-0d721f2a819e
Commits

Reviewing files that changed from the base of the PR and between c1fa0ce and 6bd5e85.

Files ignored due to path filters: 1

  • go.sum is excluded by !**/*.sum
Files selected for processing: 4

  • Dockerfile
  • go.mod
  • graphql/authorization/auth.go
  • graphql/authorization/auth_test.go

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Clears the two HIGH findings failing ci-dgraph-nightly-cves:

- CVE-2026-116587 (GHSA-mgcc-cww5-fp2q), go-jose/v4 <= 4.1.5. jwk.go
  hands RSA modulus and primes straight to rsa.PrivateKey.Validate(),
  which is cubic in their size on Go 1.24+, so a crafted key burns CPU.
  graphql/authorization unmarshals every key served by the configured
  JWK URLs, so a hostile endpoint reaches it.
- CVE-2026-78661, golang.org/x/net <= 0.61.0. Two DoS bugs in
  x/net/html: unchecked ancestor namespace transitions when rendering
  raw text, and quadratic text-node coalescing. No package in the tree
  imports x/net/html; it ships in the binary as a transitive module and
  govulncheck confirms it is never called.

x/net v0.63.0 pulls crypto, mod, sync, sys, term, text and tools
forward with it.
Clears the two findings govulncheck reports in the dgraph binary.
Neither is HIGH in Trivy today, so the nightly scan passes without
them; both are linked into the shipped binary, unlike the x/net/html
bug that only gates it.

- GO-2026-6859 / CVE-2026-97054, net/http before go1.27.4. When an
  HTTP/1 server exceeds MaxBytesReader's limit, the race setting
  "Connection: close" can crash it. Raised as a go directive rather
  than a toolchain line, so GOTOOLCHAIN=local builds fail instead of
  quietly shipping the 1.27.3 stdlib; the root Dockerfile builder moves
  with it and every workflow reads go-version-file.
- GO-2026-6865, klauspost/compress before v1.20.2. fse and huff0 panic
  on two-block frames; Badger's zstd compression links both in.
Clears CVE-2026-128085 (MEDIUM), where a nested attribute value could
slip past the SDK's length limits; 1.47.0 caps attribute value depth at
64. Same go.mod change as dependabot's #9890 and #9891, which this
replaces.

Dgraph uses the trace SDK, the OTLP HTTP exporter, propagation and
zpages, so neither of the release's two removals applies: the dropped
OTEL_GO_X_METRIC_EXPORT_BATCH_SIZE belongs to the metric SDK, and the
dropped Go 1.25 support is below the go directive.
go-jose 4.1.6 caps JWK RSA moduli at 4096 bits, so a key above the cap
now fails to parse. FetchJWK returned on the first such key, FetchJWKs
returns on the first failing URL, and NewHandler returns on that, so one
oversized key in one JWKS stopped the GraphQL schema from loading at
all - including on restart, after an upgrade.

A key that cannot be parsed cannot verify a token either way, so skip it
and keep the rest of the set: verification looks keys up by kid, and a
token signed by a skipped key now fails with "Invalid kid" rather than
taking every other key down with it. Each skipped key is logged with its
kid. A set where no key is usable is still an error, so an entirely
unusable JWKS fails loudly rather than verifying nothing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant