Skip to content

fix(security): bump pgx/x/net/x/text and raise go.mod floor - #63

Open
moizpgedge wants to merge 3 commits into
mainfrom
FIx/PLAT-690/Security-Codacy-Triage-security-issues
Open

fix(security): bump pgx/x/net/x/text and raise go.mod floor#63
moizpgedge wants to merge 3 commits into
mainfrom
FIx/PLAT-690/Security-Codacy-Triage-security-issues

Conversation

@moizpgedge

@moizpgedge moizpgedge commented Jul 30, 2026

Copy link
Copy Markdown

What this fixes

A security scan flagged 23 warnings in this project's dependencies —
2 rated Critical, 12 High. All of them traced back to one thing: a
few outdated open-source libraries and an outdated version of the
underlying programming language itself. Updated all of them to
current, patched versions. No feature changes, no behavior changes.

What was updated

  • The library used to talk to the Postgres database
  • The library used for network/HTTP communication
  • The library used for text processing
  • The minimum required version of the programming language itself

How I checked this actually fixes things

For the language-version update, I didn't just trust the report: I
built the actual program with the old, vulnerable version and
confirmed 6 of the flagged issues were genuinely present and
reachable (things like how it verifies server identity and handles
secure connections, both used every time this service talks to
Kubernetes or the database). Rebuilt with the updated version and
confirmed all 6 were gone.

Also ran the full test suite and the same security scanner against
the updated code: everything passes, and the scan now reports zero
warnings at any severity level.

Relationship to the other open security PR

A separate security scan (Trivy, PR #62) already fixed three of these
same library versions. This PR reuses that exact fix and adds the one
thing that scan didn't separately call out: the language-version
update. Whichever of the two PRs merges first, the other will need a
small follow-up cleanup — not a blocker, just a heads-up.

What this doesn't do

This only updates the source code. The already-published image that
people are currently using was built before this fix and isn't
automatically updated by it — a new version needs to be built and
released separately once this merges.

Fixes PLAT-690.

The published ghcr.io/pgedge/pgedge-helm-utils:v1.0.0 image reported
2 Critical, 5 High, 4 Medium, and 1 Low finding, all Go module or
stdlib CVEs (this image's runtime stage is FROM scratch, so there is
no OS package layer at all to have findings in).

- github.com/jackc/pgx/v5: 5.8.0 -> 5.9.2. Fixes CVE-2026-33815 and
  CVE-2026-33816 (memory-safety) and, as a bonus not in the original
  report, GO-2026-5004 (SQL injection via placeholder confusion),
  which govulncheck shows reachable from
  internal/spock/replication_slot_advance.go. Confirmed that call site
  uses bind parameters ($1, $2) and this codebase never sets
  QueryExecModeSimpleProtocol, so the reachable path isn't actually
  exploitable as written, but the version bump removes the exposure
  regardless of future changes to how queries are issued.
- golang.org/x/net: 0.47.0 -> 0.56.0. Fixes CVE-2026-25681,
  CVE-2026-27136, CVE-2026-33814, CVE-2026-39821, and several
  golang.org/x/net/html and dns/dnsmessage advisories govulncheck
  found that weren't individually broken out in the report.
- golang.org/x/text: 0.31.0 -> 0.39.0. Fixes GO-2026-5970, reachable
  via the Kubernetes dynamic client's List() call and
  pgx.ConnectConfig.

The reported os.Root symlink CVE (CVE-2026-39822) and remaining
Medium/Low findings were stdlib issues in the toolchain used to build
the published image; the Dockerfile's builder stage already floats on
the "golang:1.25" tag, so a fresh build picks up the current patch
release with no Dockerfile change needed.

Added .trivy/pgedge-helm-utils.trivyignore.yaml (empty
vulnerabilities list) to match the convention in the sibling
pgedge-postgres-mcp/pgedge-rag-server repos and give future scans a
place to land justified entries; nothing needs suppressing right now.

Verified: go build, go vet, go test ./... (all packages), make
test-unit (Helm chart template rendering), and helm lint all pass.
govulncheck ./... reports no vulnerabilities. Built the image fresh
from this branch and ran `trivy image --ignorefile
.trivy/pgedge-helm-utils.trivyignore.yaml`: 0 findings at every
severity.
The Codacy report lists a batch of stdlib CVEs against go.mod's
declared 1.25.9 floor (net/mail, crypto/x509, net/http/internal/http2,
os.Root, mime, net/textproto, html/template, crypto/tls, net), with
fix versions ranging up to 1.25.12. Confirmed 6 of these genuinely
reachable by building this binary with the actual go1.25.9 toolchain
and running govulncheck in binary mode: crypto/tls handshake,
net/textproto header parsing, mime header decoding, crypto/x509
hostname verification, net.Dialer, and the HTTP/2 transport — this
service does make outbound TLS/HTTP connections (to Kubernetes and
Postgres), so these aren't theoretical. Rebuilding with 1.25.12 drops
that to zero.

Also confirmed the floor is structurally durable, not just true
today: with go.mod now requiring >=1.25.12, the actual go1.25.9
toolchain refuses to build this project at all
("go: go.mod requires go >= 1.25.12").

This is on top of the pgx/x/net/x/text bumps already fixed for the
Trivy triage (PLAT-691, #62) and cherry-picked onto this branch,
which already covered CVE-2026-33815/33816/41889 (pgx),
CVE-2026-25681/27136/39821/42502/42506/25680 (x/net), and
CVE-2026-56852 (x/text) from this same Codacy report.

Verified: go build, go test ./... (all packages), make test-unit all
pass. Rebuilt the full pgedge-helm-utils image from this branch and
ran `trivy image`: 0 findings at every severity, both before and
after this additional floor bump (the dependency versions already
covered the fixable Critical/High; this closes the remaining stdlib
gap Codacy's go.mod-level scan flagged separately).
@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Warning

Review limit reached

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

Next review available in: 23 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 Plus

Run ID: edcb1f38-9eb7-44cc-a1f9-957549d1017a

📥 Commits

Reviewing files that changed from the base of the PR and between bf4feec and d3f099b.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (2)
  • .trivy/pgedge-helm-utils.trivyignore.yaml
  • go.mod

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.

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 duplication

Metric Results
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

Addresses CodeRabbit review on #62. The "Verified: 0 findings" note
in the ignore file's header comment read as if the vulnerability were
fully resolved, without saying that the published
ghcr.io/pgedge/pgedge-helm-utils:v1.0.0 tag was built before this fix
and is untouched by it. go.mod edits can't retroactively patch an
already-pushed image; consumers pinned to :v1.0.0 remain exposed
until a new image is built from this fix and released under a new
tag. Reworded to say so explicitly, matching what the PR description
already says under "Not done here."

Reverified after the change: rebuilt the image and rescanned with the
updated ignore file, still 0 findings at every severity.
@moizpgedge moizpgedge changed the title fix(security): bump pgx/x/net/x/text and raise go.mod floor Security fix: update the Go version and core libraries, close out old warnings Jul 30, 2026
@moizpgedge moizpgedge changed the title Security fix: update the Go version and core libraries, close out old warnings fix(security): bump pgx/x/net/x/text and raise go.mod floor Jul 31, 2026
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