Commit b3a6d11
committed
[MDEV-31585] Stop trusting or relying on client identifying information sent prior to the TLS handshake
The server has heretofore improperly mishandled—and TRUSTED—information sent
in the plaintext login request packet sent prior to the TLS handshake.
As a result of this, the client is *forced* to send excessive and
exploitable identifying information in the pre-TLS-handshake plaintext login
packet. That client-side vulnerability is CONC-654.
This modifies the server to stop relying on any of the information in the
pre-TLS-handshake plaintext login packet EXCEPT for the single bit that
tells it that a TLS handshake will follow. It furthermore adds a
capability bit to the server greeting packet, which informs the client that
it is safe to send a bare-bones dummy packet containing ONLY the instruction
that a TLS handshake will follow:
/* This capability is set if:
*
* - The CLIENT knows how to send a truncated 2-byte SSLRequest
* packet, containing no information other than the CLIENT_SSL flag
* which is necessary to trigger the TLS handshake, and to send its
* complete capability flags and other identifying information after
* the TLS handshake.
* - The SERVER knows how to receive this truncated 2-byte SSLRequest
* packet, and to receive the client's complete capability bits
* after the TLS handshake.
*
*/
#define CLIENT_CAN_SSL_V2 (1ULL << 37)
Because the client cannot safely send the SSL_V2 SSLRequest packet unless
the server has advertised support for it in its (plaintext) Server Greeting
packet, an active MITM could strip the CLIENT_CAN_SSL_V2 bit from that
Server Greeting packet. This downgrade attack will force the client to
continue exhibiting the CONC-654 vulnerability. The server is also modified
to detect this case and abort the connection; this won't fix the one-time
client information leakage of the CONC-654 vulnerability, but it is intended
to discourage the MITM attack by making it highly visible.
All new code of the whole pull request, including one or several files
that are either new files or modified ones, are contributed under the
BSD-new license. I am contributing on behalf of my employer Amazon Web
Services, Inc.1 parent fc45d4e commit b3a6d11
3 files changed
+90
-23
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
274 | 274 | | |
275 | 275 | | |
276 | 276 | | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
277 | 291 | | |
278 | 292 | | |
279 | 293 | | |
| |||
Submodule libmariadb updated from 3393fe3 to 8c8ac07
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12761 | 12761 | | |
12762 | 12762 | | |
12763 | 12763 | | |
| 12764 | + | |
12764 | 12765 | | |
12765 | 12766 | | |
12766 | 12767 | | |
| |||
13253 | 13254 | | |
13254 | 13255 | | |
13255 | 13256 | | |
13256 | | - | |
13257 | | - | |
13258 | | - | |
13259 | | - | |
13260 | | - | |
13261 | | - | |
13262 | | - | |
13263 | | - | |
13264 | | - | |
13265 | | - | |
13266 | | - | |
13267 | | - | |
13268 | | - | |
13269 | | - | |
13270 | | - | |
13271 | | - | |
13272 | | - | |
13273 | | - | |
13274 | | - | |
| 13257 | + | |
| 13258 | + | |
| 13259 | + | |
| 13260 | + | |
| 13261 | + | |
| 13262 | + | |
| 13263 | + | |
| 13264 | + | |
| 13265 | + | |
| 13266 | + | |
| 13267 | + | |
| 13268 | + | |
| 13269 | + | |
| 13270 | + | |
| 13271 | + | |
| 13272 | + | |
| 13273 | + | |
| 13274 | + | |
13275 | 13275 | | |
13276 | | - | |
13277 | | - | |
13278 | | - | |
13279 | 13276 | | |
| 13277 | + | |
| 13278 | + | |
| 13279 | + | |
| 13280 | + | |
| 13281 | + | |
13280 | 13282 | | |
13281 | 13283 | | |
13282 | 13284 | | |
| |||
13297 | 13299 | | |
13298 | 13300 | | |
13299 | 13301 | | |
| 13302 | + | |
| 13303 | + | |
| 13304 | + | |
| 13305 | + | |
13300 | 13306 | | |
13301 | 13307 | | |
13302 | 13308 | | |
| |||
13305 | 13311 | | |
13306 | 13312 | | |
13307 | 13313 | | |
| 13314 | + | |
| 13315 | + | |
| 13316 | + | |
| 13317 | + | |
| 13318 | + | |
| 13319 | + | |
| 13320 | + | |
| 13321 | + | |
| 13322 | + | |
| 13323 | + | |
| 13324 | + | |
| 13325 | + | |
| 13326 | + | |
| 13327 | + | |
| 13328 | + | |
| 13329 | + | |
| 13330 | + | |
| 13331 | + | |
| 13332 | + | |
| 13333 | + | |
| 13334 | + | |
| 13335 | + | |
| 13336 | + | |
| 13337 | + | |
| 13338 | + | |
| 13339 | + | |
| 13340 | + | |
| 13341 | + | |
| 13342 | + | |
| 13343 | + | |
| 13344 | + | |
| 13345 | + | |
| 13346 | + | |
| 13347 | + | |
| 13348 | + | |
| 13349 | + | |
| 13350 | + | |
| 13351 | + | |
| 13352 | + | |
| 13353 | + | |
| 13354 | + | |
| 13355 | + | |
| 13356 | + | |
13308 | 13357 | | |
13309 | 13358 | | |
| 13359 | + | |
| 13360 | + | |
| 13361 | + | |
| 13362 | + | |
13310 | 13363 | | |
13311 | 13364 | | |
13312 | 13365 | | |
| |||
0 commit comments