Skip to content
Crypto Write-up Advanced

Caveat Implementor! Key Recovery Attacks on MEGA

The MEGA web client used the same master key for a file-sharing feature (MEGAdrop) as for authentication, creating an AES-ECB encryption oracle under the user's master key. A malicious server could exploit error messages during login to learn the user's RSA private key block by block, then decrypt files shared with that user.

Martin R. Albrecht Follow

Published on mega-caveat.github.io

We discovered an ECB encryption oracle under a target user’s master key in the MEGA system. The oracle arises in the MEGAdrop feature, which is supposed to be independent of the authentication protocol, yet uses the same master key.

Martin R. Albrecht (@martinralbrecht), Miro Haller (@M__Haller), Lenka Mareková, Kenneth G. Paterson (@Yogehi), on mega-caveat.github.io

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the MEGAdrop feature reused the account master key as an AES-ECB oracle, and the client reported distinct cryptographic error conditions to the server during authentication, leaking information about the private key.

Impact

An attacker controlling the server could recover a target user's RSA private key and then decrypt files shared with that user, though the attacks require hundreds to thousands of login attempts.

What the attacker needed

Attacker controls or impersonates the MEGA server; victim uses the MEGA web client; hundreds to thousands of login attempts

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

MEGA encrypts your files with a key derived from your password, and the same key is also used to protect your account login. The researchers found that a fake MEGA server could trick the official web client into revealing small pieces of that secret key through error messages. Collect enough pieces and the whole key can be rebuilt, letting the attacker read files shared with the victim.

What is Crypto?

Encryption, signatures, randomness or certificate checks that do not protect what they claim to.

More from MEGA

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cryptographic weaknesses

The lesson behind this report.

Encryption, signatures, randomness or certificate checks that do not protect what they claim to.