RFR: 8331682: Slow networks/Impatient clients can potentially send unencrypted TLSv1.3 alerts that won't parse on the server [v9]

Artur Barashev abarashev at openjdk.org
Mon Sep 30 16:36:40 UTC 2024


On Mon, 30 Sep 2024 14:53:02 GMT, Artur Barashev <abarashev at openjdk.org> wrote:

>> src/java.base/share/classes/sun/security/ssl/SSLTransport.java line 133:
>> 
>>> 131:                     context.handshakeContext.negotiatedProtocol.useTLS13PlusSpec()) {
>>> 132:                 ByteBuffer packet = srcs[srcsOffset].duplicate();
>>> 133:                 packet.position(0);
>> 
>> Can we assume that this position will always be zero, or do we need to store the initial position before calling inputRecord.decode?
>
> I think we can't, good catch. It is unlikely that the alert will be following another command in the buffer but it is technically possible. I'll make a change.

Another consideration: we won't be handling this error when `SSLSocket` is being used

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/21043#discussion_r1781439698


More information about the security-dev mailing list