agora inbox for pgsql-committers@postgresql.org  
help / color / mirror / Atom feed
From: Noah Misch <noah@leadboat.com>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix unbounded recursive handling of SSL/GSS in ProcessStartupPac
Date: Mon, 11 May 2026 12:19:37 +0000
Message-ID: <E1wMPbl-0002U8-1D@gemulon.postgresql.org> (raw)

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

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/f7a191f5377dacd05d22dd40c1d1e38b393ea9b4
Author: Michael Paquier <michael@paquier.xyz>

Modified Files
--------------
src/backend/tcop/backend_startup.c     | 23 +++++++++-
src/test/postmaster/meson.build        |  1 +
src/test/postmaster/t/004_negotiate.pl | 82 ++++++++++++++++++++++++++++++++++
3 files changed, 104 insertions(+), 2 deletions(-)



view thread (6+ messages)  latest in thread

Message-ID: <E1wMPbl-0002U8-1D@gemulon.postgresql.org>
Permalink:  ../E1wMPbl-0002U8-1D@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1wMPbl-0002U8-1D@gemulon.postgresql.org

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: noah@leadboat.com, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Fix unbounded recursive handling of SSL/GSS in ProcessStartupPac
  In-Reply-To: <E1wMPbl-0002U8-1D@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox