Lune

Abstract

MEGA is a large-scale cloud storage and communication platform that aims to provide end-to-end encryption for stored data. A recent analysis by Backendal, Haller and Paterson (IEEE S&P 2023) invalidated these security claims by presenting practical attacks against MEGA that could be mounted by the MEGA service provider. In response, the MEGA developers added lightweight sanity checks on the user RSA private keys used in MEGA, sufficient to prevent the previous attacks.

We analyse these new sanity checks and show how they themselves can be exploited to mount novel attacks on MEGA that recover a target user's RSA private key with only slightly higher attack complexity than the original attacks. We identify the presence of an ECB encryption oracle under a target user's master key in the MEGA system; this oracle provides our adversary with the ability to partially overwrite a target user's RSA private key with chosen data, a powerful capability that we use in our attacks. We then present two distinct types of attack, each type exploiting different error conditions arising in the sanity checks and in subsequent cryptographic processing during MEGA's user authentication procedure. The first type appears to be novel and exploits the manner in which the MEGA code handles modular inversion when recomputing u = q -1 mod p. The second can be viewed as a small subgroup attack (van Oorschot and Wiener, EUROCRYPT 1996, Lim and Lee, CRYPTO 1998). We prototype the attacks and show that they work in practice.

As a side contribution, we show how to improve the RSA key recovery attack of Backendal-Haller-Paterson against the unpatched version of MEGA to require only 2 logins instead of the original 512.

We conclude by discussing wider lessons about secure implementation of cryptography that our work surfaces.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

5 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Zero Knowledge (About) Encryption: A Comparative Security Analysis of Three Cloud-based Password Managers cites Victory by KO: Attacking OpenPGP Using Key Overwriting
  • Zero Knowledge (About) Encryption: A Comparative Security Analysis of Three Cloud-based Password Managers cites End-to-End Encrypted Cloud Storage in the Wild: A Broken Ecosystem
  • Zero Knowledge (About) Encryption: A Comparative Security Analysis of Three Cloud-based Password Managers cites MFKDF: Multiple Factors Knocked Down Flat
  • End-to-End Encrypted Cloud Storage in the Wild: A Broken Ecosystem cites Victory by KO: Attacking OpenPGP Using Key Overwriting
  • MFKDF: Multiple Factors Knocked Down Flat cites Victory by KO: Attacking OpenPGP Using Key Overwriting
  • MFKDF: Multiple Factors Knocked Down Flat cites Four Attacks and a Proof for Telegram
  • End-to-End Encrypted Git Services cites End-to-End Encrypted Cloud Storage in the Wild: A Broken Ecosystem
  • Analyzing Cryptography in Context: A Cryptography-Native Approach to Threat Modeling cites Four Attacks and a Proof for Telegram
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers5

  1. End-to-End Encrypted Cloud Storage in the Wild: A Broken EcosystemJonas Hofmann, Kien Tuong TruongCCS 2024 · 5 citations
  2. MFKDF: Multiple Factors Knocked Down FlatMatteo Scarlata, Matilda Backendal, Miro HallerUSENIX Security 2024 · 3 citations
  3. End-to-End Encrypted Git ServicesYa-Nan Li, Yaqing Song, Qiang Tang, Moti YungCCS 2025 · 1 citation
  4. Zero Knowledge (About) Encryption: A Comparative Security Analysis of Three Cloud-based Password ManagersMatteo Scarlata, Giovanni Torrisi, Matilda Backendal, Kenneth G. PatersonUSENIX Security 2026
  5. Analyzing Cryptography in Context: A Cryptography-Native Approach to Threat ModelingRan Canetti, Julie Ha, Gabriel KaptchukUSENIX Security 2026

Builds on7

  1. SoK: Computer-Aided CryptographyManuel Barbosa, Gilles Barthe, Karthik Bhargavan, Bruno Blanchet et al.S&P 2021 · 169 citations
  2. Dragonblood: Analyzing the Dragonfly Handshake of WPA3 and EAP-pwdMathy Vanhoef, Eyal RonenS&P 2020 · 146 citations
  3. Advanced Lattice Sieving on GPUs, with Tensor CoresLéo Ducas, Marc Stevens, Wessel P. J. van WoerdenEUROCRYPT 2021 · 44 citations
  4. Four Attacks and a Proof for TelegramMartin R. Albrecht, Lenka Mareková, Kenneth G. Paterson, Igors StepanovsS&P 2022 · 40 citations
  5. Victory by KO: Attacking OpenPGP Using Key OverwritingLara Bruseghini, Daniel Huigens, Kenneth G. PatersonCCS 2022 · 6 citations

Related papers

  1. MEGA: Malleable Encryption Goes AwryMatilda Backendal, Miro Haller, Kenneth G. PatersonS&P 2023
  2. A Formal Treatment of End-to-End Encrypted Cloud StorageMatilda Backendal, Hannah Davis, Felix Günther, Miro Haller et al.CRYPTO 2024 · 15 citations
  3. Secure Cloud Storage: Modularization, Network Adversaries and Adaptive CorruptionsJonas Janneck, Doreen RiepelEUROCRYPT 2026
  4. Cryptanalysis of the GPRS Encryption Algorithms GEA-1 and GEA-2Christof Beierle, Patrick Derbez, Gregor Leander, Gaëtan Leurent et al.EUROCRYPT 2021 · 22 citations
  5. Automated Formal Analysis of Signal's Double Ratchet: Attacks, Fixes and Security ProofsVincent Cheval, Charlie Jacomme, Jessica RichardsS&P 2026 · 3 citations
Dusk over the sea between two cliffs drawn in fine vertical lines