postgresql/src/backend
Tom Lane 9ae0f11129 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
..
access Fix typo 2021-11-08 09:17:24 -03:00
bootstrap Revert "Skip WAL for new relfilenodes, under wal_level=minimal." 2020-03-22 09:24:14 -07:00
catalog Avoid crash in rare case of concurrent DROP 2021-11-05 12:29:34 -03:00
commands Invalidate partitions of table being attached/detached 2021-10-18 19:08:25 -03:00
executor Report tuple address in data-corruption error message 2021-08-30 16:29:12 -04:00
foreign Abstract logic to allow for multiple kinds of child rels. 2017-04-03 22:41:31 -04:00
lib Rename rbtree.c functions to use "rbt" prefix not "rb" prefix. 2018-11-06 13:25:24 -05:00
libpq Reject extraneous data after SSL or GSS encryption handshake. 2021-11-08 11:01:43 -05:00
main Install Windows crash dump handler before all else. 2017-11-12 14:31:04 -08:00
nodes Ensure that expandTableLikeClause() re-examines the same table. 2020-12-01 14:02:28 -05:00
optimizer Silence another gcc 11 warning. 2021-01-28 17:18:42 -05:00
parser Remove bogus assertion in transformExpressionList(). 2021-10-19 11:35:15 -04:00
po Fix typo 2021-11-08 09:17:24 -03:00
port Make EXEC_BACKEND more convenient on macOS. 2021-08-13 11:10:28 +12:00
postmaster Reject extraneous data after SSL or GSS encryption handshake. 2021-11-08 11:01:43 -05:00
regex Make pg_regexec() robust against out-of-range search_start. 2021-09-11 15:20:04 -04:00
replication Handle XLOG_OVERWRITE_CONTRECORD in DecodeXLogOp 2021-11-01 13:07:23 -03:00
rewrite Fix rewriter to set hasModifyingCTE correctly on rewritten queries. 2021-09-08 12:05:43 -04:00
snowball Initial pgindent run with pg_bsd_indent version 2.0. 2017-06-21 14:39:04 -04:00
statistics Release memory allocated by dependency_degree 2021-09-23 18:55:22 +02:00
storage Reset lastOverflowedXid on standby when needed 2021-11-06 18:34:26 +03:00
tcop Refactor CHECK_FOR_INTERRUPTS() to add flexibility. 2021-05-14 12:54:26 -04:00
tsearch Don't leak compiled regex(es) when an ispell cache entry is dropped. 2021-03-18 21:44:43 -04:00
utils Fix CREATE INDEX CONCURRENTLY for the newest prepared transactions. 2021-10-23 18:36:43 -07:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
common.mk Add ICU_CFLAGS to global CPPFLAGS 2017-06-12 15:57:22 -04:00
Makefile Fix make rules that generate multiple output files. 2018-03-23 13:45:38 -04:00
nls.mk Translation updates 2018-05-07 11:59:42 -04:00