arXiv:2609.11882cs.CRSep 2026

Manuscript Offprint

arXiv:2609.11882

From Specs to Apps: Verifying and Monitoring Models of Signal and WhatsApp

Moustafa Said, Aurora Naska, Kevin Morio, Robert Künnemann

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

The Signal protocol is a prominent messaging protocol that secures communication for billions of users. It powers WhatsApp, the most widely used messaging application worldwide, and the Signal app, popular among privacy-conscious users. Extensive research in the computational and Dolev-Yao settings provides strong formal security guarantees for the protocol itself. However, a gap remains between the guarantees of the protocol specification and the implementation's actual behavior at runtime.

In this work, we bridge this gap by applying SpecMon, a recently proposed runtime monitor, to check whether observed executions conform to formal protocol models. To this end, we instrument two applications (WhatsApp Web and Signal Desktop) to capture their interactions with the network and the cryptographic components. Using this instrumentation, we develop two multiset-rewrite models that are compatible with Tamarin, thus enabling verification. We derive the first model of WhatsApp Web's implementation of the Signal protocol and the most detailed model to date of Signal's original protocol. Monitoring establishes that observed executions conform to these models, relative to the trusted event extraction and the symbolic abstraction. For the core components of the Signal protocol, we verify authentication and secrecy properties. Finally, monitoring reveals previously undocumented differences between the original libsignal library and WhatsApp's fork.

We evaluate our methodology and demonstrate its reproducibility. Developing the WhatsApp Web model, instrumenting the app, adding fuzzing, and running the experiments took three person-weeks. We also demonstrate efficient monitoring of real-world applications and detection of deliberately injected security faults, with low overhead in our measured setting.

1 Introduction

The Signal protocol is a prominent messaging protocol that secures the daily communications of billions of users worldwide. This open-source protocol [62] serves as the backbone of a multitude of modern messaging apps, including Signal [63], WhatsApp [71], Facebook Messenger [25], and Google Messages [30].

Due to its prevalence, there has been extensive research [7, 18, 21, 27, 37, 43, 68, 3, 15, 10, 34, 26, 39] to formally analyze the protocol.

Aurora Naska

aurora.naska@cispa.de

CISPA Helmholtz Center for Information Security

Saarbrücken, Germany

Robert Künnemann

robert.kuennemann@cispa.de

CISPA Helmholtz Center for Information Security

Saarbrücken, Germany

In particular, the use of state-of-the-art automated verification tools like Tamarin [45] and ProVerif [11] has enabled analysis of some of the more complex security guarantees of the protocol [9, 21, 39]. However, keeping verification tractable often requires abstracting protocol details or focusing on a particular component instead of the entire system.

This leaves a verification gap: guarantees proved on a formal model do not transfer to the actual implementation of the protocol. The implementation may deviate from the model in various ways, e.g., by omitting security-relevant steps, by using different cryptographic primitives, or by introducing bugs. To further complicate matters, although messaging apps use an open-source protocol, they are typically closed-source, making it even more difficult to build trust that the theoretical guarantees of the underlying protocol transfer to the application. Facebook (now Meta), the current owner of WhatsApp, was named in the NSA's PRISM disclosures [32], which contributed to long-standing concerns among security-conscious users about WhatsApp's trustworthiness. Nevertheless, both Signal [28, 48] and WhatsApp [33] are still used for highly classified communication despite government restrictions.

It is hence fundamental to ensure that the implementation conforms to the verified model. Techniques for doing so include code verification [65], verified compilers (cv2ocaml [14], cv2fstar [40], and the compiler of [2]), type checking (F* [66]), model extraction [1, 37, 51], (automated) theorem proving [36], and refinement from specifications [8, 56, 6]. In contrast to these static techniques, which either require substantial proof effort or apply only to limited implementations, dynamic verification (runtime monitoring) provides a flexible, black-box view of the program. SpecMon [50], a recently proposed runtime monitoring engine, addresses this problem by checking compliance with a formal model during the execution of a protocol implementation. Within the bounds of the Dolev-Yao (DY) model and the monitored scope, guarantees of the formal model transfer to accepted implementation traces.

In this work, we establish formal models that allow SpecMon to monitor secure messaging applications. This entails two key tasks. First, the implementation needs to be instrumented, i.e., cryptographic components and network interfaces are identified and their inputs and outputs are exposed to the monitor. Second, the

∗^{*}This is an extended version of [59].

model needs specification-level information that verification models sometimes omit. In theory, this only requires a description of the concrete on-the-wire format (SpecMon provides a language to express this that is backward compatible with Tamarin). In practice, formal models often omit potentially critical details for the sake of verification. To capture the desired behaviors of the implementation, more detail can be necessary.

Our work targets two prominent Signal protocol implementations: WhatsApp Web, version 2.3000.1029798056 (November 2025), and Signal Desktop, version 7.56.0-alpha.1 (April 2025). Our Signal Desktop experiments use libsignal v0.70.0.

In our first case study, we monitor Signal Desktop [61], an open-source client, to detect deviations during application runtime. Starting from an initial model of Signal's session-handling layer, Extended Triple Diffie-Hellman (X3DH), and Double Ratchet (DR) [21, 57], we enhance the model with the post-quantum key exchange (PQXDH) [38], now supported by Signal, Sealed Sender [41], and other details omitted in previous work, such as cipher-key derivations. This leads to the most detailed model for Signal to date, which is validated against the actual implementation.

In our second case study, we show that this methodology also applies to closed-source implementations. We monitor a WhatsApp client [71] using Chrome DevTools [29], instrumenting WhatsApp's modified version of libsignal. Starting from traces generated by the application and no previous model, we extract the first formal model of WhatsApp's implementation of the Signal protocol.

For both models, we use Tamarin to prove authentication and secrecy of the initial root key under the threat models described in Section 7. For Signal, the analysis also considers an attacker that can break the Diffie-Hellman (DH) assumption. The authentication guarantee does not cover a DH break before the responder completes the handshake. We also instantiate an impossibility result [22] against post-compromise security (PCS, the guarantee that a conversation's security can be restored after its secrets are compromised) in our setting. Additionally, we point out undocumented differences between Signal's and WhatsApp's DR implementations.

Our work demonstrates the practical value of monitoring real-world applications. First, our methodology enables fast and efficient model extraction of complex protocols: developing the WhatsApp Web model, instrumenting the app, adding fuzzing, and running the experiments took three person-weeks. Second, and more significantly, maintaining closely related monitoring and verification variants of one MSR model creates a shared validation point. Accepted observed traces conform to the monitorable variant within the stated trust and abstraction boundaries, while documented transformations connect that variant to the model used for proof. This makes the remaining abstraction gap explicit and permits both variants to be updated as the implementation evolves. Third, our artifacts support model extraction for other Signal-based apps.

More broadly, monitorable models offer benefits beyond verification by enabling integration into the development lifecycle for continuous validation. Developers can use these models as in-depth testing tools to ensure ongoing compliance with protocol specifications and as a form of executable documentation. Our work thus provides both the methodology and instrumentation for tech-savvy end users to establish greater trust in their messaging applications, while offering vendors a systematic approach to document and maintain protocol correctness over time.

All materials and models needed to reproduce and extend our results are available as described in Appendix A.

Contributions. We make the following contributions:

  • We are the first to demonstrate the feasibility of monitoring production-scale messaging applications with low measured overhead using SpecMon. We provide a methodology and reusable artifacts that enable quick and efficient monitoring of other Signal-based applications.

  • We develop the most detailed model of Signal, unifying and extending prior Tamarin models. We monitor it against the implementation and verify authentication and initial-root-key secrecy. Sealed Sender is monitored for fidelity but not separately verified.

  • We develop the first formal model of WhatsApp Web's Signal-protocol variant, monitor it against the implementation, and verify authentication and initial-root-key secrecy. Both models reproduce the known conversation-PCS counterexample.

Outline. We introduce formal verification and runtime monitoring in Section 2. Our monitoring methodology is presented in Section 3, followed by case studies on Signal Desktop and WhatsApp Web in Sections 4 and 5. We evaluate our approach through model validation, fault injection, and performance measurements in Section 6. Formal verification results are discussed in Section 7, and related work in Section 8. Finally, we present limitations, lessons learned, future work, and conclusions in Sections 9 to 11.