postgresql/src/backend/postmaster
Tom Lane 28e2412554 Reject extraneous data after SSL or GSS encryption handshake.
The server collects up to a bufferload of data whenever it reads data
from the client socket.  When SSL or GSS encryption is requested
during startup, any additional data received with the initial
request message remained in the buffer, and would be treated as
already-decrypted data once the encryption handshake completed.
Thus, a man-in-the-middle with the ability to inject data into the
TCP connection could stuff some cleartext data into the start of
a supposedly encryption-protected database session.

This could be abused to send faked SQL commands to the server,
although that would only work if the server did not demand any
authentication data.  (However, a server relying on SSL certificate
authentication might well not do so.)

To fix, throw a protocol-violation error if the internal buffer
is not empty after the encryption handshake.

Our thanks to Jacob Champion for reporting this problem.

Security: CVE-2021-23214
2021-11-08 11:01:43 -05:00
..
Makefile process startup: Move AuxiliaryProcessMain into its own file. 2021-08-05 12:12:11 -07:00
autovacuum.c Make autovacuum launcher more responsive to pg_log_backend_memory_contexts(). 2021-10-12 09:50:17 +09:00
auxprocess.c pgstat: Bring up pgstat in BaseInit() to fix uninitialized use of pgstat by AV. 2021-08-06 19:05:59 -07:00
bgworker.c Remove support for background workers without BGWORKER_SHMEM_ACCESS. 2021-08-13 05:49:26 -07:00
bgwriter.c Run checkpointer and bgwriter in crash recovery. 2021-08-02 17:32:44 +12:00
checkpointer.c pgstat: split reporting/fetching of bgwriter and checkpointer stats. 2021-08-04 19:16:04 -07:00
fork_process.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
interrupt.c Update copyright for 2021 2021-01-02 13:06:25 -05:00
pgarch.c Make archiver process handle barrier events. 2021-06-18 17:57:09 +09:00
pgstat.c pgstat: Prepare to use mechanism for truncated rels also for droppped rels. 2021-09-20 14:02:48 -07:00
postmaster.c Reject extraneous data after SSL or GSS encryption handshake. 2021-11-08 11:01:43 -05:00
startup.c Fix race condition in startup progress reporting. 2021-10-29 14:40:15 -04:00
syslogger.c Fix compilation warning in syslogger.c 2021-10-07 16:24:26 +09:00
walwriter.c Revert "Avoid creating archive status ".ready" files too early" 2021-09-04 12:14:30 -04:00