Rust at Scale: An Added Layer of Security for WhatsApp

(engineering.fb.com)

47 points | by ubj 5 hours ago ago

7 comments

  • storystarling 21 minutes ago

    The hardest part of a rewrite like this is usually maintaining bug-for-bug compatibility with the legacy parser rather than the actual Rust implementation. Most real-world media files are malformed in some way that the C++ code implicitly handled, so if you write a strict parser you end up breaking valid user data. Differential fuzzing seems like the only practical way to map that behavior without manually reviewing millions of edge cases.

    • dwattttt 3 minutes ago

      It sounds like it's a design goal of this "wamedia" to _not_ maintain bug compatibility with media players.

  • nevi-me an hour ago

    > We believe that this is the largest rollout globally of any library written in Rust.

    I suppose this is true because there's more phones using WhatsApp than there are say Windows 11 PCs.

    Given that WhatsApp uses libsignal, is it safe to assume that they haven't been using the Rust library directly?

    • pjmlp 16 minutes ago

      If you watch "Microsoft is Getting Rusty: A Review of Successes and Challenges" it appears the whole effort is more on the Azure side, and besides some timid adoption like GDI regions, there is a lukewarm adoption of Rust on Windows side, still pretty much a C and C++ feud.

      https://www.youtube.com/watch?v=1VgptLwP588

    • marisen 26 minutes ago

      WhatsApp doesn't use libsignal, and Android is already pretty Rusty and deployed more than WhatsApp around the world (not just smartphone. Tons of "embedded" use cases also run on custom Android)

      • pjmlp 15 minutes ago

        Like our gym devices that have a full tablet to run a basic application to control weights, talk about wasting money.

  • kpcyrd 2 hours ago

    Very cool! I'm wondering if Signal is doing something similar? libsignal is implemented in Rust, but I don't know about the other parts.