postgresql/src/backend/postmaster
Tom Lane e92ed93e8e 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
..
autovacuum.c pgindent run prior to branching v13. 2020-06-07 16:57:08 -04:00
bgworker.c Be more careful about barriers when releasing BackgroundWorkerSlots. 2021-05-15 12:21:06 -04:00
bgwriter.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
checkpointer.c Spelling adjustments 2020-06-07 15:06:51 +02:00
fork_process.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
interrupt.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
Makefile Partially deduplicate interrupt handling for background processes. 2019-12-17 13:14:28 -05:00
pgarch.c Make archiver's SIGQUIT handler exit via _exit(). 2020-09-09 15:32:34 -04:00
pgstat.c Fix assorted issues in backend's GSSAPI encryption support. 2020-12-28 17:44:17 -05:00
postmaster.c Reject extraneous data after SSL or GSS encryption handshake. 2021-11-08 11:01:43 -05:00
startup.c Shut down transaction tracking at startup process exit. 2021-04-06 02:27:11 +09:00
syslogger.c Remove am_syslogger global variable 2020-03-13 14:01:15 +01:00
walwriter.c Revert "Avoid creating archive status ".ready" files too early" 2021-09-04 12:14:30 -04:00