Sourced from github.com/jackc/pgx/v5's changelog.
5.10.0 (June 3, 2026)
This release includes a significant amount of hardening against malicious or compromised PostgreSQL servers, contributed by Sean Chittenden at CrowdStrike, Inc. This work bounds binary decoders against attacker-controlled message sizes, caps server-supplied SCRAM iteration counts, adds
require_authto restrict which authentication methods a server may use (mitigating downgrade attacks undersslmode=prefer), and ensures cancellation requests are sent over TLS when the original connection used TLS.Features
- Add
require_authto restrict accepted server authentication methods (Sean Chittenden at CrowdStrike, Inc.)- Add
ParseConfigOptions.ConnStringAllowedKeysto restrict allowed connection string keys (Sean Chittenden at CrowdStrike, Inc.)- Add
StructArgsandStrictStructArgsfor@-named queries (Tubelight30)- Add
ErrConnClosedsentinel error and unwrap it fromconnLockError(Charlie Tonneslan)- pgxpool: check if connection is expired before acquire (arthurdotwork)
Security Hardening
- Encrypt
CancelRequestconnection when the primary connection used TLS (Sean Chittenden at CrowdStrike, Inc.)- Cap server-supplied SCRAM iteration count (Sean Chittenden at CrowdStrike, Inc.)
- Default Frontend max message body length to ~1 GiB (Sean Chittenden at CrowdStrike, Inc.)
- Bound hstore binary decode against malicious server input (Sean Chittenden at CrowdStrike, Inc.)
- Bound array binary decode element length against remaining message bytes (Sean Chittenden at CrowdStrike, Inc.)
- Bound array element count against remaining message bytes (Sean Chittenden at CrowdStrike, Inc.)
- Bound range, multirange, and tsvector binary decoders (Sean Chittenden at CrowdStrike, Inc.)
- Document secure connection configuration (Sean Chittenden at CrowdStrike, Inc.)
- Fix panic on malformed geometric text; return an error instead (MaIII)
Fixes
- Fix scanning
"char"(OID 18) into*stringin binary format (luongs3)- Fix handling of typed-nil
driver.Valuerin array and composite codecs (Donncha Fahy)- Fix
CopyData.Datahex decoding inUnmarshalJSON(Charlie Tonneslan)- Fix data race when context is cancelled during connect
- Fix
parseKeywordValueSettingsrejecting trailing whitespace (alliasgher)- pgconn: preserve full error chain in
normalizeTimeoutError(Charlie Tonneslan)- pgconn: use a fresh context for the fallback connection in
connectPreferred(Charlie Tonneslan)- pgxpool: fix
MaxLifetimeDestroyCountand ping order for acquire-time expiry check- Add missing error check of
rows.Errto load types (Jen Altavilla)
7293fb1
Update changelog for v5.10.01ade285
pgconn: document secure connection configurationb4d6d4d
pgtype: bound range, multirange, and tsvector binary decoders0639b37
pgconn: add ParseConfigOptions.ConnStringAllowedKeysb28e65b
pgtype: bound array element count against remaining message bytescd1f389
pgtype: bound array binary decode element length against remaining
bytesff27b5b
pgtype: bound hstore binary decode against malicious server inputa6002e1
pgproto3: default Frontend max message body length to ~1 GiB44f6173
pgconn: cap server-supplied SCRAM iteration count1a976f7
pgconn: add require_auth to restrict accepted server auth methods