[TLS] Re: Security Concern in TLS 1.3 and OpenSSL Implementation

Muhammad Usama Sardar <muhammad_usama.sardar@tu-dresden.de> Mon, 17 November 2025 18:01 UTC

Return-Path: <muhammad_usama.sardar@tu-dresden.de>
X-Original-To: tls@mail2.ietf.org
Delivered-To: tls@mail2.ietf.org
Received: from localhost (localhost [127.0.0.1]) by mail2.ietf.org (Postfix) with ESMTP id 12EAC8B22A66 for <tls@mail2.ietf.org>; Mon, 17 Nov 2025 10:01:44 -0800 (PST)
X-Virus-Scanned: amavisd-new at ietf.org
X-Spam-Flag: NO
X-Spam-Score: -4.397
X-Spam-Level:
X-Spam-Status: No, score=-4.397 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: mail2.ietf.org (amavisd-new); dkim=pass (2048-bit key) header.d=tu-dresden.de
Received: from mail2.ietf.org ([166.84.6.31]) by localhost (mail2.ietf.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KMmgckR11DnX for <tls@mail2.ietf.org>; Mon, 17 Nov 2025 10:01:41 -0800 (PST)
Received: from mailout3.zih.tu-dresden.de (mailout3.zih.tu-dresden.de [141.30.67.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by mail2.ietf.org (Postfix) with ESMTPS id AE3038B229D7 for <tls@ietf.org>; Mon, 17 Nov 2025 10:01:32 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tu-dresden.de; s=dkim2022; h=Content-Type:In-Reply-To:CC:From:References:To :Subject:MIME-Version:Date:Message-ID:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=nG/A+AIFH+TDZoENb1Wtqm7XQPfktfwYhfkgug47i1U=; b=i2Y2/vlUbR88dRiWAphLF+8feC NevLdwyj4AI2/zfVsvxzB0GfTuyP/tzV4R0fs2MnfjJW6AbKm0kkdiOBrU2LtZ8iq4CcdSgNbULQp b8ZOdLav3eXBGRmatoh797RrFthLQWTVgpJNIPcSdOugYRkup+O+NCJo8OL7kUYrcTGWM+V9r6BcX eMNFBJ1Ut2JY2qmQ1D0rCzsMHUof6xXA9m6KjSJ+N8X8rThfXsoxA0CEWjtZ/qnbau48LR8TAsoOH K7EiVQT5Il/Fm9dHu32G+JnNd7Ttz/NKOK9kbEf9YgJCVyg2vgb3g2IvQpdvdOwtjk+ICAGtTE7Fc KZYWmR3A==;
Received: from msx-t422.msx.ad.zih.tu-dresden.de ([172.26.35.139] helo=msx.tu-dresden.de) by mailout3.zih.tu-dresden.de with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from <muhammad_usama.sardar@tu-dresden.de>) id 1vL3Xf-00DOIn-Hn; Mon, 17 Nov 2025 19:01:32 +0100
Received: from [10.12.5.228] (141.76.13.149) by msx-t422.msx.ad.zih.tu-dresden.de (172.26.35.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.29; Mon, 17 Nov 2025 19:01:18 +0100
Message-ID: <a649b086-9c38-4e06-bf06-0b5f57e0e9cb@tu-dresden.de>
Date: Mon, 17 Nov 2025 19:01:17 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
To: "H.Rafiee" <ietf@rozanak.com>
References: <7f563479-c1ac-4678-9d96-f8a0d8fb0e69@rozanak.com>
Content-Language: en-US
From: Muhammad Usama Sardar <muhammad_usama.sardar@tu-dresden.de>
In-Reply-To: <7f563479-c1ac-4678-9d96-f8a0d8fb0e69@rozanak.com>
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg="sha-512"; boundary="------------ms040309070109090207010600"
X-ClientProxiedBy: MSX-L421.msx.ad.zih.tu-dresden.de (172.26.34.141) To msx-t422.msx.ad.zih.tu-dresden.de (172.26.35.139)
X-TUD-Virus-Scanned: mailout3.zih.tu-dresden.de
Message-ID-Hash: KLGYT2TD3FDTJIKCHI2ZHXJMISLEJFOA
X-Message-ID-Hash: KLGYT2TD3FDTJIKCHI2ZHXJMISLEJFOA
X-MailFrom: muhammad_usama.sardar@tu-dresden.de
X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-tls.ietf.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header
CC: tls@ietf.org
X-Mailman-Version: 3.3.9rc6
Precedence: list
Subject: [TLS] Re: Security Concern in TLS 1.3 and OpenSSL Implementation
List-Id: "This is the mailing list for the Transport Layer Security working group of the IETF." <tls.ietf.org>
Archived-At: <https://mailarchive.ietf.org/arch/msg/tls/cqlteWfGcO4fxODZXfhm7sRengE>
List-Archive: <https://mailarchive.ietf.org/arch/browse/tls>
List-Help: <mailto:tls-request@ietf.org?subject=help>
List-Owner: <mailto:tls-owner@ietf.org>
List-Post: <mailto:tls@ietf.org>
List-Subscribe: <mailto:tls-join@ietf.org>
List-Unsubscribe: <mailto:tls-leave@ietf.org>

Hello Hosnieh,

I am not an OpenSSL expert (and it may be the case that the key names 
used there are a source of confusion) but from specification 
perspective, I find your explanation of keys very confusing. Also, I am 
not sure what kind of /randomness/ you are looking for. Please see inline:

On 17.11.25 17:40, H.Rafiee wrote:
> In short, TLS 1.3 uses 0-RTT to improve performance. To achieve this, it derives a key from the pre-shared key (PSK or master key)
I am not sure why you call it "master key". Such a key name does not 
exist in TLS 1.3 specs (neither RFC8446 nor RFC8446bis). There was 
"Master secret" in RFC8446 which is now "Main secret" in RFC8446bis but 
that's a completely different key compared to PSK. And "Main secret" is 
generated very late in the key schedule, which seems irrelevant to your 
explanation.
> , called the early secret (in OpenSSL). This early secret is derived in a very simple way
What do you mean by "very simple way"? What in addition to HKDF-Extract 
were you expecting to generate Early Secret from PSK?
> and is used for encrypting and authenticating the first communications.

That's actually not correct. Early Secret itself is never used except 
for generating three other keys via application of Derive-Secret in the 
first stage of derivation. One of those three keys is 
client_early_traffic_secret, which is then used to generate 
client_write_key via application of HKDF-Expand-Label in the second 
stage of derivation. client_write_key is the one used for encrypting 
0-RTT data.

> The main concern is that this early secret is neither randomized nor changed after system startup.
This is because the assumption is that PSK remains secret. Could you 
please clarify what do you mean by "system startup"? Are you resuming 
connections multiple times with the same PSK?
> For subsequent session keys, a static value is also used as input to the session key generation function, along with a few random values.

I am a bit lost in your terminology here. Which "static value"? Are you 
referring to the /label/ inputs for Derive-Secret?

Which "few random values"? Are you referring to the state of the 
handshake used as input in Derive-Secret? If so, there is nothing more 
than ClientHello available at the time when this key is generated, so I 
am not sure how one can add more "randomness".

> As a result, the session key may not be sufficiently random.
Which "session key" exactly?
> Questions to the community:
>
> Is this an OpenSSL implementation issue, or a protocol-level security problem?
> Were there any tests conducted for the protocol before its release?
> Is this issue already known?
I don't think it's an issue but I may be missing something. Please 
provide answers to my questions.
> Security risks:
> If there is a bug in the system or the early secret is not well protected in memory (it cannot be stored in an HSM or trusted environment because it needs to be readily available to TLS library), an attacker could reproduce or decrypt communication in case of vulnerabilities in one of the communicating systems.
Sure, if Early Secret is not protected, there is nothing preventing 
0-RTT data. That is by design.
> Even if the TLS library uses isolated memory space, any bug in OpenSSL could expose the secret.
Same applies here.
> Since the early secret lacks sufficient randomness, it seems necessary to change the PSK to prevent attackers from establishing secure communication.

Again, please clarify "randomness". Where would that random value be 
stored? Imagine somehow the randomness is there, if attacker has access 
to memory, can't it get that random value too?

> Generally speaking, the role of the PSK is weak here. Even if it is well protected, as long as the early secret is poorly protected, knowing the early secret compromises the entire system.

Yes, that is by design. PSK-only does not have the same properties as 
the full handshake with ECDHE. In particular, losing Early Secret in 
PSK-only breaks all guarantees for 0-RTT data.

In general, you may find Section 1.3 in [0] helpful for general 
understanding of TLS key schedule.

-Usama

[0] 
https://www.researchgate.net/publication/396245726_Perspicuity_of_Attestation_Mechanisms_in_Confidential_Computing_Validation_of_TLS_13_Key_Schedule