CVE-2024-25679
Executive Summary
CVE-2024-25679 is a vulnerability in the PQUIC library, an implementation of the QUIC protocol. The flaw lies in the retention of unused initial encryption keys after the handshake is complete. An attacker who can sniff network traffic can leverage these retained keys to forge a CONNECTION_CLOSE frame, encrypted with the initial key, and send it to a peer that is using a Pre-Shared Key (PSK) configuration. This action disrupts the established QUIC connection. The vulnerability is present in versions prior to commit 5bde5bb. No public proof-of-concept (PoC) or exploit code is currently available, and the CVSS score is listed as 0.0, likely due to incomplete scoring data.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
CVSS Breakdown & Threat Level
The CVSS score is listed as 0.0, which is atypical and likely indicates that the scoring vector has not been fully assigned or published by NVD. Based on the technical description, a reasonable assessment would be:
- Attack Vector (AV): Network (N) - The attacker needs network access to sniff traffic and send packets.
- Attack Complexity (AC): High (H) - Requires network sniffing and knowledge of the initial encryption keys.
- Privileges Required (PR): None (N)
- User Interaction (UI): None (N)
- Scope (S): Unchanged (U)
- Confidentiality (C): None (N) - No data is disclosed.
- Integrity (I): Low (L) - The attacker can send a CONNECTION_CLOSE frame, but cannot modify data.
- Availability (A): High (H) - The attack directly causes a denial of service by terminating the connection.
Estimated CVSS Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:H
Estimated Score: 5.9 (Medium)
The threat level is Medium, as exploitation requires network sniffing and is limited to denial of service. However, in environments where QUIC is critical for performance or where PSK configurations are used for authentication, this could be a significant availability risk.
Deep Dive & Mechanics
The QUIC protocol uses initial encryption keys derived from the handshake to protect early data. After the handshake completes, these keys should be discarded in favor of stronger, handshake-derived keys. In PQUIC, the initial encryption keys are retained even after the handshake is complete.
An attacker who can observe the network traffic can compute the initial encryption keys. With these keys, the attacker can craft a CONNECTION_CLOSE frame, encrypt it with the initial key, and send it to a peer that is using a PSK configuration. The peer, still accepting packets encrypted with the initial key (due to the bug), will decrypt the frame and terminate the connection.
The attack is specific to PSK configurations because the initial key derivation in PSK mode may have different properties or the peer may be more permissive in accepting initial-key-encrypted packets after the handshake. The core issue is the violation of the QUIC protocol's security principle that initial keys must be discarded after the handshake.
Vulnerable vs. Patched Code
The vulnerability is in the key management logic of PQUIC. The vulnerable code retains the initial encryption keys in memory and continues to accept packets encrypted with them after the handshake.
Vulnerable Code (Conceptual):
// In the connection state structure
struct quic_conn {
// ...
quic_encrypt_level initial_keys; // Retained after handshake
// ...
};
// When processing incoming packets
if (decrypt_with_level(packet, &conn->initial_keys)) {
// Process packet even after handshake is complete
process_packet(packet);
}
Patched Code (Conceptual):
// After handshake completion
void discard_initial_keys(quic_conn *conn) {
// Zero out and free the initial keys
secure_zero(&conn->initial_keys, sizeof(conn->initial_keys));
conn->initial_keys_available = false;
}
// When processing incoming packets
if (conn->handshake_complete && packet->level == INITIAL) {
// Reject packets encrypted with initial keys after handshake
return;
}
The fix in commit 5bde5bb ensures that initial encryption keys are properly discarded and that packets encrypted with them are rejected after the handshake is complete.
Exploitation & Lab Setup
Red Team (Offensive)
Prerequisites:
- Network access to sniff traffic between the client and server using PQUIC with PSK.
- Ability to inject packets into the network stream.
Exploitation Steps:
- Sniff the QUIC handshake: Capture the initial handshake packets between the client and server.
- Derive initial keys: Using the captured handshake data, compute the initial encryption keys. This requires knowledge of the QUIC key derivation function.
- Craft CONNECTION_CLOSE frame: Create a QUIC
CONNECTION_CLOSEframe with an appropriate error code. - Encrypt and send: Encrypt the frame using the derived initial key and send it to the target peer (either client or server).
- Observe disruption: The target peer will decrypt the frame and terminate the connection.
Lab Setup:
- Use a test environment with two machines running a vulnerable version of PQUIC.
- Configure the application to use PSK for authentication.
- Use a tool like
tcpdumpor Wireshark to capture traffic. - Use a custom script or Scapy to craft and inject the malicious packet.
Blue Team (Defensive)
Detection:
- Monitor for unexpected
CONNECTION_CLOSEframes, especially those arriving shortly after the handshake. - Look for patterns where a connection is terminated immediately after establishment.
- Analyze network traffic for anomalies in the QUIC packet sequence.
Prevention:
- Apply the patch (commit
5bde5bb) immediately. - Implement network segmentation to limit an attacker's ability to sniff traffic.
- Use additional encryption layers (e.g., VPN) to protect QUIC traffic.
- Monitor for unauthorized network access.
Indicators of Compromise (IOCs)
- Network:
- QUIC
CONNECTION_CLOSEframes with error codes that do not match expected application behavior. - QUIC packets with the initial encryption level appearing after the handshake is complete.
- QUIC
- System:
- Logs showing unexpected connection terminations in applications using PQUIC.
- Unusual patterns in QUIC connection lifetimes (very short connections).
Detection Engineering
YARA Rule
rule CVE_2024_25679_PQUIC_Initial_Key_Retention {
meta:
description = "Detects PQUIC connections where initial keys are retained after handshake"
author = "Valters IT"
date = "2024-01-01"
reference = "CVE-2024-25679"
strings:
$initial_key_usage = /QUIC.*INITIAL.*CONNECTION_CLOSE/
condition:
$initial_key_usage
}
Sigma Rule
title: CVE-2024-25679 - PQUIC Initial Key Retention
id: 12345678-1234-1234-1234-123456789012
status: experimental
description: Detects network traffic indicating exploitation of CVE-2024-25679
author: Valters IT
date: 2024-01-01
logsource:
category: network_connection
product: zeek
detection:
selection:
protocol: quic
event: connection_close
encryption_level: initial
condition: selection
falsepositives:
- Legitimate QUIC implementations that may use initial keys for a short period
level: medium
Suricata Rule
alert udp any any -> any any (msg:"CVE-2024-25679 - PQUIC Initial Key Retention Exploit"; content:"|01|"; offset:0; depth:1; content:"|00|"; within:1; content:"|00 00 00 00|"; within:4; sid:1000001; rev:1;)
Note: This is a simplified rule. A real rule would need to parse the QUIC packet structure more precisely.
Remediation & Mitigation
Immediate:
- Update PQUIC to the latest version that includes commit
5bde5bb. - If immediate patching is not possible, disable PSK configurations and use certificate-based authentication instead.
Long-term:
- Implement a security review process for all cryptographic protocol implementations.
- Ensure that key material is properly discarded after use in all components.
- Monitor for similar vulnerabilities in other QUIC implementations.
Workarounds:
- Use network-level encryption (e.g., IPsec) to protect QUIC traffic from sniffing.
- Implement anomaly detection to identify unexpected
CONNECTION_CLOSEframes.
Valters IT
DevSecOps & Cyber Threat Intelligence
What is this? Security researchers use these exact search queries on Shodan.io (a search engine for internet-connected devices) to find vulnerable systems globally. You can copy these dorks to see if your organization's IP space is exposed.