postgresql/src/include/libpq
Tom Lane 9394fb8289 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
..
auth.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
be-fsstubs.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
crypt.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
hba.h Fix unportable use of getnameinfo() in pg_hba_file_rules view. 2020-11-02 21:11:50 -05:00
ifaddr.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
libpq-be.h Fix postmaster's behavior during smart shutdown. 2020-08-14 13:26:57 -04:00
libpq-fs.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
libpq.h Reject extraneous data after SSL or GSS encryption handshake. 2021-11-08 11:01:43 -05:00
pqcomm.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
pqformat.h Remove duplicate function declarations. 2018-08-14 14:25:14 -04:00
pqmq.h Update copyright for 2018 2018-01-02 23:30:12 -05:00
pqsignal.h In the postmaster, rely on the signal infrastructure to block signals. 2020-10-15 12:50:57 -04:00
scram.h Fix detection of passwords hashed with MD5 or SCRAM-SHA-256 2019-04-23 15:43:32 +09:00