CVE-2024-58265
Executive Summary
CVE-2024-58265 is a low-severity denial-of-service vulnerability in the snow crate for Rust, affecting versions prior to 0.9.5. The flaw resides in the stateful TransportState implementation, where an attacker can increment a nonce value, causing legitimate messages to be rejected and effectively denying message delivery. This vulnerability has a CVSS score of 3.1, indicating low impact, but it can disrupt communication in systems relying on the Noise Protocol Framework for secure channels.
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
Supply Chain & Package Security
This vulnerability affects the Rust crate snow, which is a pure Rust implementation of the Noise Protocol Framework. The crate is distributed via crates.io and is used in various Rust projects for secure communication. The supply chain risk is moderate, as the vulnerability can be exploited by any network actor who can observe and manipulate nonce values in transit. Users are advised to update to version 0.9.5 or later to mitigate the issue.
CVSS Breakdown & Threat Level
- CVSS Score: 3.1 (Low)
- Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L
- Attack Vector: Network (AV:N)
- Attack Complexity: High (AC:H) – requires ability to intercept and modify network traffic
- Privileges Required: None (PR:N)
- User Interaction: None (UI:N)
- Scope: Unchanged (S:U)
- Confidentiality Impact: None (C:N)
- Integrity Impact: None (I:N)
- Availability Impact: Low (A:L) – denial of message delivery
The low score reflects the high attack complexity and limited impact (only availability affected). However, in critical communication systems, even low-severity DoS can be leveraged for further attacks.
Deep Dive & Mechanics
The snow crate implements the Noise Protocol Framework, which uses nonces for replay protection in stateful transport protocols. In the vulnerable versions, the TransportState does not properly validate nonce increments. An attacker who can observe and modify network packets can increment the nonce field in a valid message. When the receiver processes this modified message, it updates its expected nonce to a higher value. Subsequent legitimate messages with the original nonce are then rejected as "replayed" or "out of order," effectively denying delivery.
The root cause is a missing check that the nonce increment is exactly 1 (or within a valid range) for each message. Instead, the implementation accepts any nonce greater than the current expected value, allowing an attacker to skip ahead.
Vulnerable vs. Patched Code
Vulnerable (pre-0.9.5):
// In TransportState::decrypt
if nonce < self.nonce {
return Err(Error::Decrypt);
}
self.nonce = nonce;
// ... decrypt message
Patched (0.9.5+):
// In TransportState::decrypt
if nonce != self.nonce {
return Err(Error::Decrypt);
}
self.nonce = nonce.wrapping_add(1);
// ... decrypt message
The fix ensures that only the exact expected nonce is accepted, and the nonce is incremented by exactly 1 after successful decryption.
Exploitation & Lab Setup
Red Team
Prerequisites:
- Ability to intercept and modify network traffic between two parties using
snowcrate < 0.9.5 - Knowledge of the Noise protocol handshake and transport state
Exploitation Steps:
- Intercept a valid encrypted message from the sender.
- Modify the nonce field in the message header to a higher value (e.g., increment by 1 or more).
- Forward the modified message to the receiver.
- The receiver accepts the message (due to vulnerable nonce check) and updates its expected nonce.
- All subsequent legitimate messages with the original nonce are rejected, causing denial of service.
Example using Python with scapy (conceptual):
from scapy.all import *
def exploit(packet):
if packet.haslayer(TCP) and packet[TCP].dport == 12345:
# Modify nonce in payload (assuming offset 0)
payload = bytearray(packet[TCP].payload)
if len(payload) > 4:
# Increment nonce by 1 (little-endian)
nonce = int.from_bytes(payload[0:4], 'little')
nonce += 1
payload[0:4] = nonce.to_bytes(4, 'little')
packet[TCP].payload = bytes(payload)
return packet
sniff(filter="tcp port 12345", prn=exploit, store=0)
Blue Team
Detection:
- Monitor for sudden increases in message rejection rates.
- Look for nonce values that are not sequential (e.g., jumps of more than 1).
- Use network intrusion detection systems to flag packets with nonce anomalies.
Mitigation:
- Immediately upgrade to
snowversion 0.9.5 or later. - Implement additional application-layer sequence number validation.
- Use encrypted channels that prevent nonce manipulation (e.g., TLS).
Indicators of Compromise (IOCs)
- Network: Packets with nonce values that are not exactly 1 greater than the previous expected nonce.
- Logs: Repeated "Decrypt" errors in application logs indicating nonce mismatch.
- Behavior: Legitimate messages being rejected without cause, leading to communication breakdown.
Detection Engineering
YARA Rule
rule CVE_2024_58265_Snow_Nonce_DoS {
meta:
description = "Detects potential exploitation of CVE-2024-58265 in snow crate"
author = "Valters IT"
date = "2025-04-10"
reference = "https://nvd.nist.gov/vuln/detail/CVE-2024-58265"
strings:
$nonce_check = { 48 3B ?? ?? 0F 82 ?? ?? ?? ?? } // cmp nonce, [reg]; jb
$nonce_update = { 48 89 ?? ?? } // mov [reg], nonce
condition:
$nonce_check and $nonce_update
}
Sigma Rule
title: CVE-2024-58265 Snow Nonce Manipulation
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects nonce manipulation attempts against snow crate < 0.9.5
author: Valters IT
date: 2025-04-10
logsource:
category: application
product: rust
detection:
selection:
EventID: 1001 # Example: custom error event
Message: "Decrypt error: nonce mismatch"
condition: selection
falsepositives:
- Legitimate network issues causing packet reordering
level: medium
Suricata Rule
alert tcp any any -> any any (msg:"CVE-2024-58265 Snow Nonce DoS Attempt"; flow:to_server; content:"|00 00 00 01|"; offset:0; depth:4; content:"|00 00 00 02|"; within:4; sid:1000001; rev:1;)
Remediation & Mitigation
- Immediate: Upgrade the
snowcrate to version 0.9.5 or later. - Compensating Controls: Implement application-layer sequence numbers that are validated independently of the Noise protocol.
- Network Segmentation: Restrict network access to only trusted parties to reduce the attack surface.
- Monitoring: Enable logging of all decryption failures and alert on anomalies.
- Patch Management: Regularly update all Rust dependencies using
cargo update.
Valters IT
DevSecOps & Cyber Threat Intelligence
Securing the Digital Frontier