Formal verification is necessary because manual analysis alone often fails to uncover subtle flaws in cryptographic protocols [
24,
25], and vulnerabilities in handshake design can have critical consequences in 5G roaming security. To ensure rigorous evaluation of TLS 1.3 handshake variants, we employ ProVerif, a symbolic model checker based on the applied pi-calculus and the Dolev–Yao adversary model. ProVerif has been widely used for protocols such as TLS 1.3 and Signal [
26,
27], and its automated verification of secrecy, authentication, and correspondence properties makes it well-suited for our roaming context. As shown in
Figure 5, ProVerif belongs to the category of unbounded model checking tools, meaning it can analyze protocols with an arbitrary number of sessions and messages rather than being restricted to finite state spaces.
4.1. Security Models and Algorithmic Framework
The paper implements six key algorithms for formal verification using ProVerif with pi-calculus methodology aligned with ISO/IEC 29128-1:2023 standards.
Algorithm 1 establishes the formal verification framework by defining channel specifications for secure communication, security requirement verification queries (Q1–Q6), and event definitions for protocol step validation. This foundational algorithm creates the symbolic model checker environment under the Dolev–Yao adversary model, where the attacker has complete control over the network but cannot break cryptographic primitives.
Algorithm 1 Declaration & Queries |
- 1:
(* Channel specification *) - 2:
free c: channel. - 3:
free sp: channel [private]. - 4:
(* Type specification *) - 5:
type G, exponent, label, keyid, key. - 6:
(* Application Data specification *) - 7:
free App Data1, App Data2, App Data3: bitstring [private]. - 8:
(* TLS 1.3 Label specification *) - 9:
const p_b_binder, c_e_traffic : label. - 10:
(* Queries specification *) - 11:
event S_STEP1_C_to_S(keyid, key, bitstring, bitstring, bitstring). - 12:
event E_STEP1_C_to_S(keyid, key, bitstring, bitstring, bitstring). - 13:
event S_STEP2_S_to_C(keyid, key, label, bitstring). - 14:
event E_STEP2_S_to_C(keyid, key, label, bitstring). - 15:
event S_STEP3_C_to_S(keyid, key, label, bitstring). - 16:
event E_STEP3_C_to_S(keyid, key, label, bitstring). - 17:
(* Security requirements verification *) - 18:
query kid: keyid, psk: key, rand: bitstring, binder: bitstring, ClienttHello: bitstring; - 19:
Q1: inj-event(E_STEP1_C_to_S(kid, psk, rand, binder, ClienttHello)) - 20:
==> inj-event(S_STEP1_C_to_S(kid, psk, rand, binder, ClienttHello)). - 21:
query kid: keyid, k: key, lb_finished: label, aead_finished: bitstring; - 22:
Q2: inj-event(E_STEP2_S_to_C(kid, k, lb_finished, aead_finished)) - 23:
==> inj-event(S_STEP2_S_to_C(kid, k, lb_finished, aead_finished)). - 24:
query kid: keyid, k: key, lb_finished: label, aead_finished: bitstring; - 25:
Q3: inj-event(E_STEP3_C_to_S(kid, k, lb_finished, aead_finished)) - 26:
==> inj-event(S_STEP3_C_to_S(kid, k, lb_finished, aead_finished)). - 27:
(* Secrecy verification *) - 28:
Q4: query attacker(App Data1). - 29:
Q5: query attacker(App Data2). - 30:
Q6: query attacker(App Data3).
|
Algorithm 2 initializes a fresh ‘session_id’ and ‘psk’, then runs vSEPP (client) and hSEPP (server) in parallel with unbounded replication to allow arbitrary interleavings and replays. In ‘phase 1’, it outputs ‘initial_psk’ on ‘c’ to model post-handshake key exposure, enabling forward secrecy evaluation.
Algorithm 3 implements the full handshake approach with complete certificate-based authentication, featuring mutual certificate verification against RAEX trust anchors, (EC)DHE key exchange for PFS, and PLMN ID validation in certificate SAN records. This algorithm provides the strongest initial security guarantees through comprehensive certificate verification and key exchange, making it ideal for first-time roaming partner establishments between previously unconnected PLMNs.
Algorithm 4 presents the PSK-only mode utilizing PSK authentication with efficient key derivation without certificate overhead, HKDF-based traffic key generation, and bilateral PSK agreement validation, while this approach eliminates certificate exchange overhead, it sacrifices forward secrecy, making it suitable when PSKs are securely managed and key compromise risk is minimal.
Algorithm 5 introduces the PSK-(EC)DHE hybrid approach that combines PSK efficiency with forward secrecy through PSK authentication with ephemeral key exchange, DHE shared secret integration into handshake secret derivation, and a balanced security-performance approach. This hybrid method provides both mutual authentication and PFS, making it suitable for high-security roaming scenarios.
Algorithm 6 implements standard 0-RTT with early data transmission capability, featuring immediate application data transmission, early traffic secret derivation, and session resumption capabilities. This algorithm reduces handshake latency for time-sensitive 5G network function communications but introduces security risks, including replay attacks and limited forward secrecy.
Algorithm 7 presents the novel 0-RTT FS contribution, enhancing standard 0-RTT with server ephemeral keys embedded in resumption tickets, client ephemeral key generation for each session, and combined PSK+DH secret derivation for forward secrecy. This innovative approach addresses fundamental limitations in standard TLS 1.3 early data mechanisms.
Table 1 summarizes the formal verification queries defined in our ProVerif model. Queries Q1–Q3 verify correspondence and injectivity properties that ensure mutual authentication and secure key exchange between client and server events. Queries Q4–Q6 focus on secrecy properties, checking whether application data remains confidential against an active Dolev–Yao adversary. Together, these six queries cover the core TLS 1.3 requirements of authentication, confidentiality, integrity, forward secrecy, and replay protection in the N32 roaming context
Algorithm 2 Main Process with FS |
1: (* Main Process *) 2: process 3: new initial_sid: session_id; 4: new initial_psk: key; 5: 6: ( (!proc_vSEPP(initial_sid, initial_psk)) | (!proc_hSEPP()) | 7: phase 1; out(c, initial_psk) 8: )
|
Algorithm 3 TLS 1.3 full handshake option for N32 Roaming |
- 1:
Input: supported_groups, certificate_chain, roaming_context - 2:
Output: full handshake secure channel with forward secrecy - 3:
Step 1: vSEPP ClientHello Generation - 4:
- 5:
, - 6:
- 7:
Event - 8:
Send to hSEPP - 9:
Event - 10:
Step 2: hSEPP ServerHello and Certificate Exchange - 11:
, - 12:
- 13:
- 14:
Event - 15:
Send to vSEPP - 16:
Event - 17:
Step 3: vSEPP Certificate Verification and Key Exchange - 18:
Verify server certificate chain against RAEX trust anchor - 19:
Validate PLMN ID in server certificate SAN records - 20:
▷ Client computes shared secret - 21:
▷ No PSK input - 22:
▷ Includes DHE - 23:
- 24:
Event - 25:
Send to hSEPP - 26:
Event - 27:
Step 4: hSEPP Certificate Verification and Session Completion - 28:
Verify client certificate chain against RAEX trust anchor - 29:
Validate PLMN ID in client certificate SAN records - 30:
▷ Server computes shared secret - 31:
Recompute handshake and application keys using - 32:
Verify client Finished message, send server Finished
|
Algorithm 4 TLS 1.3 PSK-only option for N32 Roaming |
- 1:
Input: , , roaming_context - 2:
Output: PSK-only secure channel - 3:
Step 1: vSEPP ClientHello Generation - 4:
- 5:
- 6:
- 7:
- 8:
- 9:
Event - 10:
Send to hSEPP - 11:
Event - 12:
Step 2: hSEPP ServerHello and Key Derivation - 13:
Verify using shared - 14:
- 15:
- 16:
▷ No DHE input - 17:
- 18:
Event - 19:
Send to vSEPP - 20:
Event - 21:
Step 3: Session Completion - 22:
vSEPP verifies server Finished message - 23:
Event - 24:
Send client to hSEPP - 25:
Event
|
Algorithm 5 TLS 1.3 PSK-(EC)DHE option for N32 Roaming |
- 1:
Input: , , supported_groups - 2:
Output: PSK-(EC)DHE secure channel with forward secrecy - 3:
Step 1: vSEPP ClientHello with Key Share - 4:
- 5:
, - 6:
- 7:
- 8:
- 9:
- 10:
Event - 11:
Send to hSEPP - 12:
Event - 13:
Step 2: hSEPP ServerHello with DHE - 14:
Verify using shared - 15:
, - 16:
- 17:
- 18:
- 19:
▷ Includes DHE - 20:
- 21:
Event - 22:
Send to vSEPP - 23:
Event - 24:
Step 3: vSEPP Key Computation and Session Completion - 25:
- 26:
Recompute handshake and application keys using - 27:
Verify server Finished message, send client Finished - 28:
Event - 29:
Event
|
Algorithm 6 TLS 1.3 0-RTT option for N32 Roaming |
- 1:
Input: , , early_data_context - 2:
Output: 0-RTT channel with immediate data transmission - 3:
Step 1: vSEPP Early Data Transmission - 4:
- 5:
, - 6:
- 7:
- 8:
- 9:
- 10:
- 11:
Event - 12:
Send to hSEPP ▷ 0-RTT data - 13:
Event - 14:
Step 2: hSEPP Early Data Processing - 15:
Verify using shared - 16:
- 17:
- 18:
Process early data immediately ▷ No handshake completion wait - 19:
, - 20:
Event - 21:
Continue with standard PSK-(EC)DHE handshake completion - 22:
Event - 23:
Step 3: Handshake Completion with End of Early Data - 24:
Complete DHE key exchange as in Algorithm 5 - 25:
vSEPP sends message - 26:
Transition to handshake traffic keys, then application traffic keys - 27:
Event - 28:
Event
|
Algorithm 7 TLS 1.3 0-RTT FS option for N32 Roaming (Simplified) |
- 1:
Input: , , resumption_ticket, early_data_context - 2:
Output: 0-RTT FS channel with forward secrecy and replay resistance - 3:
Step 1: Client Early Data with Ephemeral Keys - 4:
Extract from resumption_ticket - 5:
if then reject fi - 6:
Generate ephemeral key pair: - 7:
- 8:
- 9:
- 10:
- 11:
- 12:
Event - 13:
Send to hSEPP - 14:
Event - 15:
Step 2: Server Nonce Verification and Key Derivation - 16:
- 17:
- 18:
- 19:
if then reject - 20:
if then reject - 21:
- 22:
- 23:
Event - 24:
Process early_data, continue standard 1-RTT handshake completion - 25:
Event - 26:
Step 3: Fresh Ticket Generation - 27:
Generate fresh ephemeral key pair: - 28:
- 29:
- 30:
- 31:
Event - 32:
Send to vSEPP - 33:
Event
|
4.1.1. Replay Attacks on TLS 1.3 0-RTT
0-RTT replay attacks [
28] exploit the zero round-trip time feature in protocols like TLS 1.3 and QUIC, where clients can send encrypted application data immediately using cryptographic material from previous connections, without waiting for server interaction. The attack works by an adversary intercepting a client’s 0-RTT messages and data, forwarding them to the server (which processes the data), but then dropping the server’s response and forcing the server to lose state (e.g., through rebooting). When the attacker replays the same 0-RTT messages, the server rejects the 0-RTT portion for security reasons but continues with a regular handshake. The client, believing the data were not delivered due to the protocol’s reliable delivery mechanism, automatically resends the same application data under the final handshake key, causing the server to process identical data twice [
13]. This demonstrates that even if replay protection exists at the key exchange level, logical replays at the application level remain inevitable due to automatic retransmission mechanisms, leading TLS 1.3 to accept such replays as unavoidable rather than attempting to prevent them.
Figure 6 shows a diagram of the ProVerif attack trace for a typical 0-RTT replay attack scenario simulated on the N32 context. The analysis reveals a critical replay attack vulnerability where the same 0-RTT roaming message can be processed multiple times by the home SEPP. This occurs when a single SEPP-V process sends one 0-RTT message with crand_4 and x_25, but the home SEPP processes this identical message twice with different session IDs (sess_id_4, sess_id_5). Since the same cryptographic parameters are used, this results in identical early data encryption that passes validation in both instances, causing both to trigger E_STEP1_C_to_S events. This violates the injectivity property where one authentic send event corresponds to multiple receive events, enabling replay attacks on roaming signaling.
4.1.2. Result
The ProVerif verification summary results for each TLS option are shown in
Figure 7, while
Table 2 provides a simple explanation of the security properties for easier interpretation. Together, these results highlight the critical security differentiators between TLS 1.3 handshake options, with particular emphasis on forward secrecy and replay attack resistance, while standard 0-RTT offers performance benefits with zero round-trips, it sacrifices forward secrecy and replay protection. The proposed 0-RTT FS solution uniquely delivers both zero round-trip performance and forward secrecy through innovative ephemeral key exchange and anti-replay mechanisms, addressing fundamental limitations in conventional TLS 1.3 implementations at the cost of moderate computational overhead.
Table 3 shows a summary of the security comparison for the TLS 1.3 options.
Critical Security Differentiators: The formal verification of the results reveal significant differences in PFS support across options. Full handshake achieves complete PFS via (EC)DHE key exchange, ensuring that compromise of long-term keys cannot decrypt past communications. PSK-only mode lacks PFS entirely, making historical sessions vulnerable if the PSK is later compromised. PSK-(EC)DHE provides full PFS through its hybrid approach, combining PSK authentication with ephemeral key exchange. Standard 0-RTT offers limited PFS, with early data remaining vulnerable to long-term key compromise. The proposed 0-RTT FS achieves full PFS while maintaining zero round-trip performance through its innovative ephemeral key integration.
Replay attack resistance analysis reveals vulnerabilities across standard implementations. All conventional TLS 1.3 options demonstrate susceptibility to signaling-level replay attacks due to the absence of freshness mechanisms in ClientHello messages. Standard 0-RTT exhibits additional data-level replay vulnerability due to immediate early data transmission. The proposed 0-RTT FS provides comprehensive anti-replay protection through configurable defense mechanisms, including single-use ticket tracking, ephemeral key-based bloom filters, and application-level idempotency tokens.
0-RTT FS: The proposed 0-RTT FS option addresses fundamental limitations in standard TLS 1.3 early data mechanisms by introducing PFS while maintaining zero round-trip latency. This protocol combines PSK with fresh ephemeral DH shared secrets and implements ticket-based anti-replay protection through server-generated nonces, enabling secure early data transmission without compromising forward secrecy guarantees.
The security design of 0-RTT FS centers on three core mechanisms: forward secrecy through combined PSK and ephemeral DH key derivation using HKDF, anti-replay protection via unique server nonces embedded in resumption tickets and validated through server-side caching, and ephemeral key rotation where each ticket contains fresh server ephemeral keys. Early data encryption keys are derived from the combination of PSK, (EC)DHE shared secret (computed between client ephemeral key and server ephemeral key from ticket), and the server nonce, ensuring that compromise of long-term keys cannot decrypt past communications.
While 0-RTT FS achieves the same network round-trip count as standard 0-RTT, it incurs additional computational overhead due to (EC)DHE operations and nonce validation. This trade-off provides essential forward secrecy guarantees that standard 0-RTT lacks, making it suitable for security-critical applications where the computational cost is justified by the enhanced security properties.
Vulnerability Assessment and Threat Model Implications: The formal verification results expose critical limitations across standard TLS 1.3 options, particularly in replay attack resistance and forward secrecy provision. Standard 0-RTT suffers from both protocol-level and application-level replay vulnerabilities due to deterministic key derivation from static PSKs, while PSK compromise in standard implementations can expose historical session data.
Critical findings include protocol-level replay vulnerabilities in standard 0-RTT due to lack of freshness mechanisms, forward secrecy absence in PSK-based early data encryption, and significant security degradation upon PSK compromise. The 0-RTT FS option addresses these vulnerabilities through server nonce uniqueness verification and ephemeral key integration, providing replay resistance and forward secrecy at the cost of increased computational complexity. These findings demonstrate the necessity of enhanced security mechanisms for applications requiring both low latency and strong security guarantees.