sec(postgres): bound DedicatedProvider Neon HTTP client with neonHTTPTimeout - #32
Merged
Merged
Conversation
…Timeout
Closes SEC-PROV finding (audit wave 2026-05-29): NewDedicatedProvider used
`&http.Client{}` with NO timeout for the Neon Management API path. A hung
Neon connection would wedge the provisioning gRPC handler (and any caller
— worker storage tick, regrader) indefinitely, piling up goroutines until
OOM.
NeonBackend already bounds its client at neonHTTPTimeout (30s); the
DedicatedProvider path was an oversight in the same family.
Fix: 1-line — set Timeout on the &http.Client literal. Reuses the existing
constant so any future tuning lands in one place.
Production LOC delta: 1 functional + 5 comment lines.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes SEC-PROV finding from audit wave 2026-05-29.
Why
NewDedicatedProvider(provisioner/internal/backend/postgres/dedicated.go:40-47) used&http.Client{}with NO timeout for the Neon Management API path. A hung Neon connection would wedge the provisioning gRPC handler (and any caller — worker storage tick, regrader) indefinitely, piling up goroutines until pod OOM.NeonBackendalready bounds its client atneonHTTPTimeout(30s); theDedicatedProviderpath was an oversight in the same family.What
1-line fix on the
&http.Clientliteral: reuse the existingneonHTTPTimeoutconstant. Any future tuning lands in one place.Verification
make gategreen (build + vet +go test ./... -short -count=1).go test ./internal/backend/postgres/ -short -count=1→ ok.LOC delta: 1 functional + 5 comment lines.
🤖 Generated with Claude Code