]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix unbounded recursive handling of SSL/GSS in ProcessStartupPacket()
authorMichael Paquier <michael@paquier.xyz>
Mon, 11 May 2026 12:13:49 +0000 (05:13 -0700)
committerNoah Misch <noah@leadboat.com>
Mon, 11 May 2026 12:13:49 +0000 (05:13 -0700)
commit66cf26b9e4be1b46a5039bb7ea37f65d1e52e763
treea29e9cf3f53fa1ac71e96abe1216a907b6757fbc
parentc2e6ef86317d372f8bbca42b830c70ff3f0da275
Fix unbounded recursive handling of SSL/GSS in ProcessStartupPacket()

The handling of SSL and GSS negotiation messages in
ProcessStartupPacket() could cause a recursion of the backend,
ultimately crashing the server as the negotiation attempts were not
tracked across multiple calls processing startup packets.

A malicious client could therefore alternate rejected SSL and GSS
requests indefinitely, each adding a stack frame, until the backend
crashed with a stack overflow, taking down a server.

This commit addresses this issue by modifying ProcessStartupPacket() so
as processed negotiation attempts are tracked, preventing infinite
recursive attempts.  A TAP test is added to check this problem, where
multiple SSL and GSS negotiated attempts are stacked.

Reported-by: Calif.io in collaboration with Claude and Anthropic
Research
Author: Michael Paquier <michael@paquier.xyz>
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
Security: CVE-2026-6479
Backpatch-through: 14
src/backend/postmaster/postmaster.c
src/test/Makefile
src/test/meson.build
src/test/postmaster/.gitignore [new file with mode: 0644]
src/test/postmaster/Makefile [new file with mode: 0644]
src/test/postmaster/README [new file with mode: 0644]
src/test/postmaster/meson.build [new file with mode: 0644]
src/test/postmaster/t/004_negotiate.pl [new file with mode: 0644]