postgresql/src
Michael Paquier b63f25bddf 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
2026-05-11 05:13:46 -07:00
..
backend Fix unbounded recursive handling of SSL/GSS in ProcessStartupPacket() 2026-05-11 05:13:46 -07:00
bin pg_upgrade: Message improvements 2026-05-11 11:38:20 +02:00
common Fix assorted places that need to use palloc_array(). 2026-05-11 05:13:46 -07:00
fe_utils Rework signal handler infrastructure to pass sender info as argument. 2026-04-15 07:30:34 -04:00
include Harden our regex engine against integer overflow in size calculations. 2026-05-11 05:13:46 -07:00
interfaces Message style improvements (oauth related) 2026-05-05 10:39:13 +02:00
makefiles Add CONCURRENTLY option to REPACK 2026-04-06 21:55:08 +02:00
pl Harmonize function parameter names for Postgres 19. 2026-04-22 12:47:19 -04:00
port Fix universal builds on MacOS 2026-05-08 16:44:25 +07:00
template Switch the semaphore API on Solaris to unnamed POSIX. 2026-03-14 14:10:32 -04:00
test Fix unbounded recursive handling of SSL/GSS in ProcessStartupPacket() 2026-05-11 05:13:46 -07:00
timezone Update time zone data files to tzdata release 2026b. 2026-04-24 12:28:35 -04:00
tools Consider opfamily and collation when removing redundant GROUP BY columns 2026-05-08 12:45:51 +09:00
tutorial Force standard_conforming_strings to always be ON. 2026-01-21 15:08:38 -05:00
.gitignore
DEVELOPERS
Makefile Add CONCURRENTLY option to REPACK 2026-04-06 21:55:08 +02:00
Makefile.global.in Update Unicode data to CLDR 48.2 2026-04-13 11:13:36 +02:00
Makefile.shlib Restore AIX support. 2026-02-23 13:34:22 -05:00
meson.build Update copyright for 2026 2026-01-01 13:24:10 -05:00
nls-global.mk Fix update-po for the PGXS case 2025-10-16 20:21:05 +02:00