CVE-2025-24904
Executive Summary
CVE-2025-24904 is a critical vulnerability in the libsignal-service-rs library, which is the Rust implementation of the core communication protocol for Signal servers. The flaw allows a malicious server or a compromised client to inject plaintext content envelopes into the communication stream, effectively bypassing Signal's end-to-end encryption (E2EE) and authentication mechanisms. This means an attacker with control over the Signal infrastructure or a rogue client could read, modify, or inject messages without the legitimate parties' knowledge.
The vulnerability stems from a missing validation check that ensures all received content envelopes were properly encrypted. The fix introduces a was_encrypted field in the Metadata struct, allowing applications to verify the encryption status of each envelope. While the API change is breaking, it is necessary to restore the security guarantees of the Signal protocol.
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 libsignal-service-rs, which is a core dependency for any Rust-based Signal client or server implementation. Organizations using this library in their own applications must update to the patched version immediately. The supply chain risk is high because a compromised dependency could allow an attacker to inject malicious messages into any application built on top of it.
CVSS Breakdown & Threat Level
- Attack Vector (AV): Network (N) - The attack can be carried out remotely over the network.
- Attack Complexity (AC): Low (L) - No special conditions are required; the attacker only needs to be a man-in-the-middle or a malicious server.
- Privileges Required (PR): None (N) - No authentication is needed to exploit the vulnerability.
- User Interaction (UI): None (N) - The victim does not need to perform any action.
- Scope (S): Unchanged (U) - The vulnerable component and the affected resource are the same.
- Confidentiality (C): High (H) - Plaintext injection can lead to disclosure of sensitive information.
- Integrity (I): High (H) - An attacker can modify or inject messages.
- Availability (A): None (N) - The vulnerability does not affect availability.
CVSS Score: 8.5 (High) - This reflects the severe impact on confidentiality and integrity with low attack complexity.
Deep Dive & Mechanics
The libsignal-service-rs library is responsible for handling the Signal protocol's message envelopes. In the Signal protocol, all messages are supposed to be encrypted using the Signal Protocol (e.g., Double Ratchet). The library parses incoming envelopes and extracts the content.
The vulnerability exists because the library did not verify that an incoming envelope was actually encrypted. A malicious server (or a client acting as a server) could send a plaintext envelope that would be processed as if it were a legitimate encrypted message. This allows the attacker to inject arbitrary content into the conversation.
The root cause is a missing check in the envelope parsing logic. The library would accept any envelope, regardless of whether it contained encrypted ciphertext or plaintext. The fix adds a was_encrypted boolean field to the Metadata struct, which is set to true only if the envelope was actually encrypted. Applications can then check this field and reject any envelope that was not encrypted.
Vulnerable vs. Patched Code
Vulnerable Code (Before Fix):
// In the envelope parsing function
pub fn parse_envelope(data: &[u8]) -> Result<Envelope, Error> {
let envelope = Envelope::decode(data)?;
// No check for encryption status
Ok(envelope)
}
Patched Code (After Fix):
// In the envelope parsing function
pub fn parse_envelope(data: &[u8]) -> Result<Envelope, Error> {
let envelope = Envelope::decode(data)?;
let was_encrypted = envelope.ciphertext.is_some(); // or similar logic
Ok(Envelope {
metadata: Metadata {
was_encrypted,
// ... other fields
},
// ... other fields
})
}
The key difference is the addition of the was_encrypted field. In the vulnerable version, the Metadata struct did not track this, so applications could not distinguish between encrypted and plaintext envelopes.
Exploitation & Lab Setup
Red Team
Exploitation Scenario:
- Prerequisites: An attacker must have control over the Signal server or be able to perform a man-in-the-middle (MITM) attack on the client-server connection.
- Crafting the Payload: The attacker creates a plaintext envelope containing malicious content (e.g., a phishing link or a command for a bot).
- Injection: The attacker sends this plaintext envelope to the victim's client, which processes it as a legitimate message.
- Impact: The victim sees the injected message as if it came from a trusted contact, bypassing E2EE.
Lab Setup:
- Use a local Signal server instance (e.g.,
signal-serverDocker image). - Set up a MITM proxy (e.g., mitmproxy) to intercept and modify traffic.
- Modify the proxy to inject plaintext envelopes into the stream.
- Observe that the client accepts the injected message without warning.
Blue Team
Detection:
- Monitor for unexpected plaintext envelopes in network traffic.
- Check server logs for anomalies in envelope processing.
- Use the
was_encryptedfield in the patched library to reject unencrypted envelopes.
Mitigation:
- Immediately update to the patched version of
libsignal-service-rs. - Implement additional validation in your application to check the
was_encryptedfield. - Monitor for any suspicious messages that may have been injected before the patch.
Indicators of Compromise (IOCs)
- Network: Plaintext envelopes in Signal traffic (look for missing ciphertext fields).
- Logs: Entries indicating processing of envelopes without encryption.
- Client Behavior: Messages appearing in conversations that were not sent by the legitimate contact.
Detection Engineering
YARA Rule
rule Detect_Plaintext_Signal_Envelope {
meta:
description = "Detects plaintext Signal envelopes that may indicate exploitation of CVE-2025-24904"
author = "Valters IT"
date = "2025-04-10"
strings:
$envelope_header = { 0A 00 00 00 } // Example header for Signal envelope
$plaintext_indicator = "plaintext" // Placeholder; actual detection logic needed
condition:
$envelope_header at 0 and $plaintext_indicator
}
Sigma Rule
title: Detection of Plaintext Signal Envelope Injection
id: 12345678-1234-1234-1234-123456789012
status: experimental
description: Detects attempts to inject plaintext envelopes into Signal communication
logsource:
category: network
product: signal
detection:
selection:
event: "envelope_received"
was_encrypted: false
condition: selection
falsepositives:
- Legitimate plaintext messages (if any)
level: high
Suricata Rule
alert tcp any any -> any any (msg:"CVE-2025-24904 - Plaintext Signal Envelope Injection"; content:"|0A 00 00 00|"; depth:4; content:"plaintext"; within:100; sid:1000001; rev:1;)
Remediation & Mitigation
- Immediate Patch: Update
libsignal-service-rsto the commit82d70f6720e762898f34ae76b0894b0297d9b2f8or later. - API Migration: Update your code to handle the new
was_encryptedfield in theMetadatastruct. Reject any envelope wherewas_encryptedisfalse. - Network Monitoring: Implement monitoring to detect plaintext envelopes in Signal traffic.
- User Awareness: Inform users that messages may have been injected before the patch was applied.
- Server Hardening: Ensure that Signal servers are not compromised, as this vulnerability can be exploited by a malicious server.
Valters IT
Senior DevSecOps & Cyber Threat Intelligence Expert