CVE-2025-24904 identifies a vulnerability in the libsignal-service-rs library, a Rust implementation of the Signal messaging service's core functionality. Prior to the 82d70f672e762898f34ae76b0894b0297d9b2f8 commit, it was possible for a malicious server or client to inject plaintext content envelopes, possibly bypassing the end-to-end encryption and authentication that the Signal messaging service is known for.
This long read aims to provide a detailed explanation of the vulnerability, as well as links to original references and exploit details. We will also discuss how the vulnerability has been fixed, breaking changes introduced, and the measures affected users should take to protect themselves.
Vulnerability Details
The libsignal-service-rs library is primarily responsible for facilitating communication between Signal messaging clients and the Signal servers. This includes handling all data transfer, encryption, and authentication processes required to ensure secure communication over the platform.
The vulnerability in question allows an attacker to compromise the end-to-end encryption and authentication of messages transmitted over the Signal messaging platform. By sending specially crafted plaintext content envelopes, a malicious actor could potentially bypass these security features and view or alter message contents.
The exploit relies on a weakness in the Metadata struct that indicates whether a given message was encrypted. Prior to the vulnerability being fixed, this check was insufficient, resulting in situations where incoming content envelopes might be treated as genuine even if they had not been encrypted as expected.
You can view the diff of the changes that fixed the vulnerability in the commit link below
82d70f672e762898f34ae76b0894b0297d9b2f8
Fix Details
The vulnerability was addressed by introducing a new was_encrypted field in the Metadata struct. This additional layer of verification ensures that the library correctly identifies messages that have not gone through the expected encryption process. As a result, maliciously injected plaintext content envelopes are no longer able to bypass the end-to-end encryption and authentication.
Here's a code snippet showcasing what the new Metadata struct looks like
pub struct Metadata {
pub sender: ServiceAddress,
pub sender_device: i32,
pub timestamp: u64,
pub needs_receipt: bool,
pub was_encrypted: bool,
}
Breaking Changes
It's worth noting that the addition of the was_encrypted field to the Metadata struct has resulted in a breaking change in the API. Users of the library will need to update their code to account for this change. Fortunately, the update process should be relatively straightforward and easy to implement for most developers.
Workarounds and User Actions
Currently, there are no known workarounds available for this vulnerability. Users should update their libsignal-service-rs library to a version that includes the 82d70f672e762898f34ae76b0894b0297d9b2f8 commit or later. Doing so will protect their applications from this vulnerability and ensure that their Signal messaging communications remain secure.
Conclusion
CVE-2025-24904 is a critical vulnerability in the libsignal-service-rs library that could have been exploited by malicious actors to bypass end-to-end encryption and authentication in Signal communications. Thanks to the developer's swift actions and the introduction of an extra was_encrypted field to the Metadata struct, this vulnerability has now been fixed. Users should update their libraries to the latest version and ensure that their applications continue to provide a safe and secure messaging experience for their users.
Timeline
Published on: 02/13/2025 16:16:49 UTC