Skip to content

fix: add server ReadTimeouts, update security deps#1980

Merged
toddbaert merged 5 commits into
mainfrom
chore/dependabot-alerts
Jul 20, 2026
Merged

fix: add server ReadTimeouts, update security deps#1980
toddbaert merged 5 commits into
mainfrom
chore/dependabot-alerts

Conversation

@jonathannorris

@jonathannorris jonathannorris commented Jun 15, 2026

Copy link
Copy Markdown
Member

Summary

Resolves all cleanly patchable open Dependabot security alerts (28 of 33). The remaining 5 have no available patched version for their legacy import path — see below.

Dependabot Alerts Resolved

Alert Package Severity Fix
#260 github.com/sigstore/sigstore-go medium Bumped to v1.2.2 in test/integration
#247-#259 (13 alerts) golang.org/x/crypto critical/high/medium Already resolved on main (v0.52.0+); carried through the rebase
#207 js-yaml medium Bumped to ^4.2.0 in playground-app
#206, #202, #201 golang.org/x/net medium Bumped to v0.55.0/v0.56.0 across flagd, core, flagd-proxy, test/integration, and related test modules
#200, #199 vite medium/high Bumped to ^6.4.3 in playground-app
#197 @babel/core low Forced >=7.29.6 via npm override in playground-app
#189, #192-#196 github.com/containerd/containerd/v2 high/medium Bumped to v2.2.5 in test/integration (kept on testcontainers-go v0.41.0 — see note below)
#190 js-cookie high Forced >=3.0.7 via npm override in playground-app

Note on containerd fix: an earlier revision of this branch bumped testcontainers-go to v0.43.0 to reach patched containerd/v2, but that also changed DockerContainer.MappedPort's signature in a way that's incompatible with go-sdk-contrib/tests/flagd/v2@v2.0.2 (pinned; no newer version exists) — breaking go vet/go test compilation in test/integration (not caught by go build alone, since it doesn't compile _test.go files). Reverted testcontainers-go to v0.41.0 (API-compatible) while keeping containerd/containerd/v2 pinned at v2.2.5 via an explicit go.mod require — standard Go MVS, no replace directive needed.

Unresolvable Alerts

github.com/docker/docker (#151, #152, #184, #185, #186) in test/integration: pinned at v28.5.2+incompatible. No version ≥ that (including the advisory's referenced v29.3.1 for #152) exists under the legacy github.com/docker/docker import path in the Go module proxy — moby now ships new majors under github.com/moby/moby/v2. Transitive dependency of testcontainers/buildx/compose; unresolvable until those upstreams migrate.

Alert Package Severity Reason
#186 github.com/docker/docker high No patched version in Go module proxy
#185 github.com/docker/docker medium No patched version in Go module proxy
#184 github.com/docker/docker high No patched version in Go module proxy
#152 github.com/docker/docker high Advisory's patched version (29.3.1) not published for this import path
#151 github.com/docker/docker medium No patched version in Go module proxy

Other changes

  • Added ReadTimeout to the flagd-proxy metrics server's http.Server (flagd-proxy/pkg/service/server.go) per CodeRabbit review feedback, hardening the plain HTTP/h2c port against slow-client resource exhaustion.

Verification

  • make test, make build, and go vet pass across all Go modules (core, flagd, flagd-proxy, flagd-proxy/tests/loadtest, test/zero-downtime-flagd-proxy).
  • test/integration: go build ./..., go vet ./..., and go test (compile-only; actual container run needs a Docker daemon) all pass.
  • playground-app: npm run build succeeds; npm install --package-lock-only --dry-run reports up to date.

@jonathannorris
jonathannorris requested review from a team as code owners June 15, 2026 14:21
@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Jun 15, 2026
@jonathannorris
jonathannorris marked this pull request as draft June 15, 2026 14:21
@netlify

netlify Bot commented Jun 15, 2026

Copy link
Copy Markdown

Deploy Preview for polite-licorice-3db33c canceled.

Name Link
🔨 Latest commit 96a536d
🔍 Latest deploy log https://app.netlify.com/projects/polite-licorice-3db33c/deploys/6a5e8139a74e7a0008358779

@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 updates various dependencies, including upgrading Go modules in the integration tests and updating frontend packages in the playground application. However, critical issues were identified in the frontend dependency updates: the specified versions for @vitejs/plugin-react (^6.0.2) and vite (^8.0.16) do not exist on the public npm registry, which will cause build and installation failures.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread playground-app/package.json Outdated
Comment thread playground-app/package.json Outdated
@jonathannorris
jonathannorris force-pushed the chore/dependabot-alerts branch from fe15340 to cbc8680 Compare June 15, 2026 14:30
@jonathannorris
jonathannorris marked this pull request as ready for review June 15, 2026 20:37
@jonathannorris
jonathannorris force-pushed the chore/dependabot-alerts branch from cbc8680 to bd2e47a Compare June 29, 2026 17:00
@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@toddbaert, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 5 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f058beb6-5ea9-4579-85b9-33b24b0da7de

📥 Commits

Reviewing files that changed from the base of the PR and between 1bc6b5e and 96a536d.

⛔ Files ignored due to path filters (4)
  • flagd-proxy/tests/loadtest/go.sum is excluded by !**/*.sum
  • playground-app/package-lock.json is excluded by !**/package-lock.json
  • test/integration/go.sum is excluded by !**/*.sum
  • test/zero-downtime-flagd-proxy/go.sum is excluded by !**/*.sum
📒 Files selected for processing (9)
  • flagd-proxy/pkg/service/server.go
  • flagd-proxy/tests/loadtest/go.mod
  • flagd/pkg/service/flag-evaluation/connect_service.go
  • flagd/pkg/service/flag-evaluation/ofrep/ofrep_service.go
  • flagd/pkg/service/middleware/h2c/h2c.go
  • flagd/profiler.go
  • playground-app/package.json
  • test/integration/go.mod
  • test/zero-downtime-flagd-proxy/go.mod
📝 Walkthrough

Walkthrough

Changes

Dependency Updates

Layer / File(s) Summary
npm dependency overrides
playground-app/package.json
Updates js-yaml and vite, and pins js-cookie and @babel/core through package overrides.
Integration module dependency refresh
test/integration/go.mod
Bumps the Go toolchain and refreshes indirect container, Docker, security, telemetry, and testing dependencies, while removing github.com/pelletier/go-toml.
Proxy test dependency refresh
flagd-proxy/tests/loadtest/go.mod, test/zero-downtime-flagd-proxy/go.mod
Updates gRPC and related indirect networking, telemetry, system, text, and generated API dependencies.

h2c Server Hardening

Layer / File(s) Summary
Metrics server timeout and h2c wiring
flagd-proxy/pkg/service/server.go, flagd/pkg/service/flag-evaluation/connect_service.go
Adds a five-second metrics-server read timeout and documents staticcheck suppressions for retained h2c handling.
h2c middleware compatibility annotations
flagd/pkg/service/middleware/h2c/h2c.go
Documents deprecated h2c.NewHandler usage and suppresses staticcheck diagnostics.

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

Suggested reviewers: toddbaert

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Title check ✅ Passed The title matches the main changes: security dependency updates and adding ReadTimeouts to the server.
Description check ✅ Passed The description clearly relates to the dependency security fixes and server timeout hardening in the changeset.

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

Comment @coderabbitai help to get the list of available commands.

@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:XS This PR changes 0-9 lines, ignoring generated files. labels Jul 6, 2026
@jonathannorris
jonathannorris marked this pull request as draft July 6, 2026 14:45
@jonathannorris
jonathannorris requested a review from Copilot July 6, 2026 14:45

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR resolves patchable Dependabot security alerts by upgrading Go module dependencies across core, flagd, flagd-proxy, and test modules, and by enforcing patched npm transitive versions in the playground app.

Changes:

  • Bump github.com/containerd/containerd/v2 (and related container tooling deps) in test/integration.
  • Update golang.org/x/* and related Go dependencies across core, flagd, and flagd-proxy; add targeted staticcheck suppressions for deprecated h2c.
  • Add npm overrides in playground-app to force patched js-cookie and @babel/core versions (and refresh lockfile accordingly).

Reviewed changes

Copilot reviewed 10 out of 17 changed files in this pull request and generated no comments.

Show a summary per file
File Description
test/zero-downtime-flagd-proxy/go.mod Updates test-module Go dependencies (grpc + indirects) to newer patched versions.
test/zero-downtime-flagd-proxy/go.sum Aligns checksums with the updated go.mod dependency graph.
test/integration/go.mod Bumps testcontainers and container-related transitive dependencies (incl. containerd/containerd/v2).
test/integration/go.sum Updates checksums for the upgraded integration-test dependency set.
playground-app/package.json Adds npm overrides to force patched js-cookie and @babel/core versions.
playground-app/package-lock.json Refreshes lockfile to reflect overrides and updated transitive dependency resolutions.
flagd/pkg/service/middleware/h2c/h2c.go Documents and suppresses staticcheck deprecation warnings for h2c.NewHandler usage.
flagd/pkg/service/flag-evaluation/connect_service.go Keeps plaintext HTTP/2 metrics support via h2c while suppressing deprecation lint warnings with rationale.
flagd/go.mod Upgrades golang.org/x/net and related golang.org/x/* indirects to patched versions.
flagd/go.sum Updates checksums for the bumped Go dependencies in flagd.
flagd-proxy/pkg/service/server.go Same h2c deprecation suppression + rationale for the proxy metrics server.
flagd-proxy/go.mod Upgrades golang.org/x/net and related golang.org/x/* indirects to patched versions.
flagd-proxy/go.sum Updates checksums for the bumped Go dependencies in flagd-proxy.
flagd-proxy/tests/loadtest/go.mod Updates loadtest module dependencies (grpc + indirects) to newer patched versions.
flagd-proxy/tests/loadtest/go.sum Aligns checksums with the updated loadtest module dependency graph.
core/go.mod Upgrades golang.org/x/* dependencies in core to patched versions.
core/go.sum Updates checksums for the bumped Go dependencies in core.
Files not reviewed (1)
  • playground-app/package-lock.json: Generated file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@flagd-proxy/pkg/service/server.go`:
- Around line 149-157: The metrics server in server.go only sets
ReadHeaderTimeout on the http.Server, so slow request bodies can still hold the
h2c listener open. Update the s.metricsServer initialization to add a
ReadTimeout on the http.Server in addition to the existing ReadHeaderTimeout,
and consider setting WriteTimeout and IdleTimeout there as well. Use the
existing s.metricsServer construction and h2c.NewHandler setup as the place to
apply the timeout hardening.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d8ce310f-79bc-4832-a0e4-078e11115464

📥 Commits

Reviewing files that changed from the base of the PR and between bd2e47a and 5eeff7c.

⛔ Files ignored due to path filters (6)
  • core/go.sum is excluded by !**/*.sum
  • flagd-proxy/go.sum is excluded by !**/*.sum
  • flagd-proxy/tests/loadtest/go.sum is excluded by !**/*.sum
  • flagd/go.sum is excluded by !**/*.sum
  • test/integration/go.sum is excluded by !**/*.sum
  • test/zero-downtime-flagd-proxy/go.sum is excluded by !**/*.sum
📒 Files selected for processing (9)
  • core/go.mod
  • flagd-proxy/go.mod
  • flagd-proxy/pkg/service/server.go
  • flagd-proxy/tests/loadtest/go.mod
  • flagd/go.mod
  • flagd/pkg/service/flag-evaluation/connect_service.go
  • flagd/pkg/service/middleware/h2c/h2c.go
  • test/integration/go.mod
  • test/zero-downtime-flagd-proxy/go.mod
✅ Files skipped from review due to trivial changes (1)
  • flagd/pkg/service/middleware/h2c/h2c.go

Comment thread flagd-proxy/pkg/service/server.go
@jonathannorris
jonathannorris force-pushed the chore/dependabot-alerts branch from 5eeff7c to 20b4381 Compare July 20, 2026 14:33
@jonathannorris
jonathannorris marked this pull request as ready for review July 20, 2026 14:37
@dosubot dosubot Bot added size:S This PR changes 10-29 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Jul 20, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@flagd/pkg/service/flag-evaluation/connect_service.go`:
- Around line 296-304: Update the management http.Server construction in the
metrics server setup to add a ReadTimeout (or equivalent request-body read
limit) alongside ReadHeaderTimeout, ensuring slow h2c request bodies cannot hold
the listener open while preserving the existing health, metrics, and gRPC health
handlers.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0b50a7a5-c184-429f-843d-4d72d741a190

📥 Commits

Reviewing files that changed from the base of the PR and between 5eeff7c and 20b4381.

⛔ Files ignored due to path filters (4)
  • flagd-proxy/tests/loadtest/go.sum is excluded by !**/*.sum
  • playground-app/package-lock.json is excluded by !**/package-lock.json
  • test/integration/go.sum is excluded by !**/*.sum
  • test/zero-downtime-flagd-proxy/go.sum is excluded by !**/*.sum
📒 Files selected for processing (7)
  • flagd-proxy/pkg/service/server.go
  • flagd-proxy/tests/loadtest/go.mod
  • flagd/pkg/service/flag-evaluation/connect_service.go
  • flagd/pkg/service/middleware/h2c/h2c.go
  • playground-app/package.json
  • test/integration/go.mod
  • test/zero-downtime-flagd-proxy/go.mod
🚧 Files skipped from review as they are similar to previous changes (3)
  • test/zero-downtime-flagd-proxy/go.mod
  • flagd-proxy/tests/loadtest/go.mod
  • flagd/pkg/service/middleware/h2c/h2c.go

Comment thread flagd/pkg/service/flag-evaluation/connect_service.go
@toddbaert
toddbaert force-pushed the chore/dependabot-alerts branch from 20b4381 to 1bc6b5e Compare July 20, 2026 19:34
@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:S This PR changes 10-29 lines, ignoring generated files. labels Jul 20, 2026
@toddbaert toddbaert changed the title chore: resolve open dependabot security alerts chore: add server ReadTimeouts, update security deps Jul 20, 2026
@toddbaert toddbaert changed the title chore: add server ReadTimeouts, update security deps fix: add server ReadTimeouts, update security deps Jul 20, 2026
jonathannorris and others added 5 commits July 20, 2026 16:12
Signed-off-by: Jonathan Norris <jonathan.norris@dynatrace.com>
- github.com/containerd/containerd/v2 v2.2.4 -> v2.2.5 (high/medium, alerts #193-196)
- @babel/core <=7.29.0 -> ^7.29.6 via override (low, alert #197)

Signed-off-by: Jonathan Norris <jonathan.norris@dynatrace.com>
- golang.org/x/net v0.52.0/v0.48.0 -> v0.55.0 in flagd, core, flagd-proxy,
  flagd-proxy/tests/loadtest, test/zero-downtime-flagd-proxy (medium,
  alerts #201-206)
- github.com/testcontainers/testcontainers-go v0.41.0 -> v0.43.0 in
  test/integration, which migrates off github.com/containerd/containerd/v2
  and picks up patched transitive deps (moby/buildkit, docker/buildx,
  docker/compose) used for alert #152's fix chain
- suppress newly-introduced staticcheck deprecation warnings for
  golang.org/x/net/http2/h2c (deprecated as of x/net v0.55.0) with nolint
  directives; migrating to http.Server.Protocols is a larger refactor
  out of scope for this dependency bump

Unresolvable: github.com/docker/docker (alerts #151, #152, #184, #185,
unreachable transitive entry retained by Go's module graph pruning
(no code path imports it); the advisory's patched version 29.3.1 has
no corresponding tag in the Go module proxy for the legacy
github.com/docker/docker import path (moby has moved new majors to
github.com/moby/moby/v2), so it cannot be bumped without a
replace/override, which is disallowed for this published project.

Signed-off-by: Jonathan Norris <jonathan.norris@dynatrace.com>
…edback

- github.com/sigstore/sigstore-go v1.1.4 -> v1.2.2 in test/integration
  (medium, alert #260)
- js-yaml ^4.1.1 -> ^4.2.0 and vite ^6.4.2 -> ^6.4.3 in playground-app
  (medium/high, alerts #207, #199, #200); lockfile already resolved these
  transitively, this pins the direct specifiers to match
- Root-cause fix for a regression introduced by the prior
  testcontainers-go v0.41.0 -> v0.43.0 bump: v0.43.0's modules/compose
  changed DockerContainer.MappedPort's signature (nat.Port -> string),
  which is incompatible with go-sdk-contrib/tests/flagd/v2@v2.0.2's
  testframework (pinned, no newer version exists) and broke
  `go vet`/`go test` compilation in test/integration (go build alone
  didn't catch it since _test.go files aren't compiled by `go build`).
  Reverted testcontainers-go and testcontainers-go/modules/compose to
  v0.41.0 (API-compatible) while keeping the already-patched transitive
  containerd/containerd/v2 v2.2.5 and other bumps pinned via explicit
  go.mod requires, so alerts #189, #192-#196 remain resolved without
  reintroducing the vulnerable containerd version.
- Add ReadTimeout to the flagd-proxy metrics server's http.Server per
  CodeRabbit review feedback on this PR: ReadHeaderTimeout alone only
  bounds header parsing, leaving the plain HTTP/h2c port open to
  slow-client (Slowloris-style) resource exhaustion.

Still unresolvable: github.com/docker/docker (alerts #151, #152, #184,
#185, #186) remains at v28.5.2+incompatible in test/integration. No
version >= 28.5.2 (including the advisory's referenced 29.3.1 for
alert #152) is published under the legacy github.com/docker/docker
import path in the Go module proxy; moby now ships new majors under
github.com/moby/moby/v2, which this module graph cannot switch to
without deeper dependency surgery.

Signed-off-by: Jonathan Norris <jonathan.norris@dynatrace.com>
Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
@toddbaert
toddbaert force-pushed the chore/dependabot-alerts branch from cd4b159 to 96a536d Compare July 20, 2026 20:12
@sonarqubecloud

Copy link
Copy Markdown

@toddbaert
toddbaert merged commit 0e1e8b3 into main Jul 20, 2026
17 of 18 checks passed
@github-actions github-actions Bot mentioned this pull request Jul 20, 2026
@toddbaert
toddbaert deleted the chore/dependabot-alerts branch July 22, 2026 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants