Abort SSL negotiation if backend sends an error message.
authorTatsuo Ishii <ishii@postgresql.org>
Mon, 18 Nov 2024 06:40:53 +0000 (15:40 +0900)
committerTatsuo Ishii <ishii@postgresql.org>
Tue, 26 Nov 2024 13:03:45 +0000 (22:03 +0900)
commite3e5ba1e519db6d3617bef5601c92dd11356d01a
treebbc1001608d44ca54bd0ae3879bc9b254adace48
parent8b7af6af5c699fa51a95ffb2e4ea0495e5398eeb
Abort SSL negotiation if backend sends an error message.

In the client side implementation of SSL negotiation
(pool_ssl_negotiate_clientserver()), it was possible for a
man-in-the-middle attacker to send a long error message to confuse
Pgpool-II or client while in the SSL negotiation phase. This commit
rejects the negotiation immediately (issue a FATAL error) and exits
the session to prevent such an attack.

This resembles PostgreSQL's CVE-2024-10977.
Backpatch-through: v4.1
src/utils/pool_ssl.c