Fix/bump pgx CVE 2026 33815 33816 - #605
RlakkamGitHub wants to merge 3 commits into
Conversation
Fixes CVE-2026-33815, CVE-2026-33816 (both CVSS 9.8 Critical memory-safety issues in pgx's binary protocol decoders) and CVE-2026-41889 (SQL injection, Low) as a bonus, since all three are resolved in this release.
… CVE fix) Windows checkouts with core.autocrlf=true convert checked-in .sql fixture files to CRLF, while runtime dump/diff output stays LF-only, causing spurious test failures unrelated to any actual bug -- found while validating the pgx bump on Windows. Normalizes CRLF to LF in the three independent comparison functions that lacked it: - cmd/dump/dump_integration_test.go: normalizeSchemaOutput - internal/diff/diff_test.go: normalizeSQL (added \r to existing TrimRight char set) - cmd/include_integration_test.go: compareFileContents Verified: internal/diff now passes fully; cmd/dump failures drop from 24 to 3 (the 3 remaining are a separate, pre-existing path-separator bug in multi-file dump output, unrelated to line endings -- out of scope here); cmd's TestIncludeIntegration passes.
Greptile SummaryThis PR upgrades pgx and related dependencies, raises the module’s minimum Go version to 1.25, and makes integration-test comparisons insensitive to Windows CRLF checkout behavior.
Confidence Score: 4/5The PR appears safe to merge, but its non-blocking Go build-configuration mismatch should be corrected to avoid implicit toolchain downloads and misleading build declarations. The dependency and newline-normalization changes appear compatible, with the only accepted concern being that repository CI, release, and Docker configurations still select Go 1.24 after the module minimum moved to Go 1.25. Files Needing Attention: go.mod Important Files Changed
Reviews (1): Last reviewed commit: "Fix CRLF/LF comparison mismatch in test ..." | Re-trigger Greptile |
| go 1.24.0 | ||
|
|
||
| toolchain go1.24.7 | ||
| go 1.25.0 |
There was a problem hiding this comment.
Build Versions Remain Misaligned
The module now requires Go 1.25, but CI, release workflows, and the Docker builder still select Go 1.24. If automatic toolchain downloads are unavailable or disabled, these builds will fail; otherwise, the configured versions no longer describe the compiler actually used. Please align .github/workflows/ci-test.yml, .github/workflows/release.yml, .github/workflows/docker-latest.yml, and the Docker builder image with Go 1.25.
There was a problem hiding this comment.
🟡 Changes recommended
Build, release, Docker, Nix, and documentation configurations still reference Go 1.24 despite the new Go 1.25 requirement.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Updates pgx to address security vulnerabilities and normalizes CRLF line endings in tests.
Changes:
- Bumps pgx and related dependencies, requiring Go 1.25.
- Makes SQL fixture comparisons platform-independent.
File summaries
| File | Description |
|---|---|
go.mod |
Updates Go and dependencies. |
go.sum |
Refreshes dependency checksums. |
internal/diff/diff_test.go |
Normalizes CRLF in diff fixtures. |
cmd/include_integration_test.go |
Normalizes line endings during comparisons. |
cmd/dump/dump_integration_test.go |
Normalizes dump fixture line endings. |
Review details
- Files reviewed: 4/5 changed files
- Comments generated: 1
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| go 1.24.0 | ||
|
|
||
| toolchain go1.24.7 | ||
| go 1.25.0 |
Flagged by automated review on PR pgplex#605 (Greptile + GitHub Copilot): go.mod's minimum moved to 1.25.0 in the pgx bump commit, but 14 other references across CI workflows, Nix packaging, and docs were still pinned to 1.24. - .github/workflows/{ci-test,docker-latest,release}.yml: go-version bumped so these pipelines can actually build/test the module - nix/pgschema.nix: flipped the preference (was preferring the now too-old 1.24 when available, falling back to 1.25 -- now the reverse, preferring 1.25 with a 1.26 fallback, same pattern) - CLAUDE.md, docs/installation.mdx, docs/workflow/gitops.mdx, ir/README.md: doc-stated minimum versions updated for consistency
Problem
pgxv5.7.5 (currently required ingo.mod) has two Critical-severity (CVSS 9.8) memory-safety vulnerabilities in its binary protocol decoders — missing bounds validation on server-controlled length/count fields when parsing responses from a Postgres server (arrays, hstore, multirange, and protocol messages likeBind):Both are network-exploitable, no auth/user-interaction required, with impact rated across confidentiality, integrity, and availability — not just a crash. Since
pgschemaconnects to whatever Postgres server it's pointed at, this is directly reachable any time it's run against an untrusted or compromised server.Fix
Bump
github.com/jackc/pgx/v5tov5.9.2, which resolves both CVEs above and, as a bonus, a Low-severity SQL-injection issue also fixed in that release (CVE-2026-41889).This requires bumping
go.mod's Go version to 1.25.0, and.github/workflows/ci-test.yml'sgo-version: "1.24"accordingly — not an incidental choice, but a hard requirement: pgx v5.9.2 itself declaresgo 1.25.0as its own minimum. There's no way to take the CVE fix while staying on Go 1.24.Two other dependencies moved as a direct consequence of the bump:
golang.org/x/text(indirect,v0.24.0→v0.29.0), andgithub.com/stretchr/testify(test-only,v1.10.0→v1.11.1). Notably,golang.org/x/crypto— previously an indirect dependency carrying its own separate set of unrelated CVEs (SSH-related, unreachable inpgschema's actual code) — is dropped from the dependency tree entirely by this bump.Bonus fix (second commit, unrelated to the CVE)
While validating this on Windows, found that
core.autocrlf=trueconverts checked-in.sqltest fixtures to CRLF on checkout, while runtime dump/diff output stays LF-only — causing spurious test failures unrelated to any actual bug. Normalized CRLF to LF in the three comparison functions that lacked it (cmd/dump/dump_integration_test.go'snormalizeSchemaOutput,internal/diff/diff_test.go'snormalizeSQL,cmd/include_integration_test.go'scompareFileContents) — kept as a separate commit since it's unrelated to the pgx fix.Testing
go build ./...— clean.go test ./...— the two integration suites that exercise realplan/applyround-trips against a live Postgres instance (cmd/plan,cmd/apply) pass, as doesinternal/diffandcmd'sTestIncludeIntegration(both fixed by the CRLF commit). Threecmd/dumpmulti-file tests still fail on Windows due to a separate, pre-existing path-separator bug (\vs/in generated\iinclude directives) — unrelated to either change here, left out of scope.No source logic changed for the CVE fix itself — that commit is dependency-manifest-only (
go.mod/go.sum).