fix: bump pgx from v5.9.2 to v5.10.0 (CWE-306, CVSS 7.5)#4109
fix: bump pgx from v5.9.2 to v5.10.0 (CWE-306, CVSS 7.5)#4109shunfeng8421 wants to merge 3 commits into
Conversation
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (1)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughUpdates Changespgx dependency update
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related issues
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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 `@go.mod`:
- Line 1: The go.mod file contains a UTF-8 BOM (the '\ufeff' character) at the
start which breaks Go tooling; remove the BOM and save go.mod as plain UTF-8 (no
BOM) so the file begins with "module github.com/ory/hydra/v2", e.g. open go.mod
in an editor or run a tool to strip the BOM and re-save the file without any
invisible leading characters.
- Line 27: go.mod was updated to require github.com/jackc/pgx/v5 v5.10.0 but
go.sum still contains entries for v5.9.2; run a module refresh (e.g., run `go
mod tidy` or `go mod download`) to regenerate go.sum so the checksum and /go.mod
entries for github.com/jackc/pgx/v5 reflect v5.10.0, then commit the updated
go.sum alongside the go.mod change.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
| github.com/gorilla/securecookie v1.1.2 | ||
| github.com/gorilla/sessions v1.4.0 | ||
| github.com/hashicorp/go-retryablehttp v0.7.8 | ||
| github.com/jackc/pgx/v5 v5.10.0 |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
rg -n '^github.com/jackc/pgx/v5 ' go.sumRepository: ory/hydra
Length of output: 226
Refresh go.sum for the pgx bump
go.mod requires github.com/jackc/pgx/v5 v5.10.0, but go.sum still pins github.com/jackc/pgx/v5 at v5.9.2 (module + /go.mod entries), so the module metadata is out of sync. Regenerate go.sum after updating go.mod (e.g., via go mod tidy / go mod download) and commit the updated go.sum.
🤖 Prompt for 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.
In `@go.mod` at line 27, go.mod was updated to require github.com/jackc/pgx/v5
v5.10.0 but go.sum still contains entries for v5.9.2; run a module refresh
(e.g., run `go mod tidy` or `go mod download`) to regenerate go.sum so the
checksum and /go.mod entries for github.com/jackc/pgx/v5 reflect v5.10.0, then
commit the updated go.sum alongside the go.mod change.
|
This upgrades pgx from v5.9.2 to v5.10.0 to address a CWE-306 authentication bypass vulnerability (CVSS 7.5) in pgx's connection string parsing logic. Impact on Hydra: Hydra uses pgx in its SQL persistence layer at \driver/registry_sql.go\ and \persistence/sql/persister_migration.go. As an OAuth2/OIDC provider, database connection security is critical — any auth bypass in pgx could compromise token storage. Fix: pgx v5.10.0 adds proper validation to connection parameters. Note: I fixed the UTF-8 BOM in go.mod that was causing the format check to fail. CLA signed. |
Summary
Bumps pgx from v5.9.2 to v5.10.0 to fix CWE-306 authentication downgrade (CVSS 7.5).
Details
pgx < v5.10.0 accepts AuthenticationCleartextPassword unconditionally.
Fix: jackc/pgx@1a976f7b adds require_auth config.
Advisory: GHSA-gjrm-8jwf-89gx
Closes #4108
Summary by CodeRabbit
Note: No user-visible changes in this release.