Skip to content
Crypto Write-up Intermediate

Exploiting the Nespresso smart cards for fun and profit coffee

The Nespresso coffee machines use MIFARE Classic smart cards that store the monetary balance directly on the card. An attacker can crack the card's keys, dump its contents, modify the stored balance to an arbitrary value, and write it back to the card, thereby obtaining unlimited coffee credit.

pollevanhoof.be

Published on pollevanhoof.be

This page demonstrates the process of exploiting the common Nespresso coffee machines by dumping and modifying their custom smart cards.

The author, on pollevanhoof.be

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

Impact

An attacker could set the card's balance to the maximum possible value (€167,772.15) and use it to obtain coffee without paying, limited only by the machine's display and the card's 3-byte value field.

What the attacker needed

Physical access to a Nespresso card; an NFC card reader/writer; the mfoc and nfc-mfclassic tools

The fix

Nespresso should either upgrade to more secure smart cards or move the monetary value to a backend server, using the card only as a personal identifier; the report notes Nespresso already offers both options.

How it was found

  1. Use mfoc to crack the non-default keys on the Nespresso card and dump its contents.
  2. Charge the card with €1.50 and make a binary dump.
  3. Buy coffee to reduce the balance to €0.50 and make another dump.
  4. Compare the two dumps to find the bytes that represent the monetary value.
  5. Edit the dump to set the value to the maximum (€167,772.15).
  6. Write the modified dump back to the card using nfc-mfclassic.

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.

A smart card is a small chip card, like a bank card, that a machine reads to know how much credit you have. The Nespresso machines stored the credit amount on the card itself, and the card's encryption was already known to be breakable. So someone with a cheap card reader could copy the card, change the number that says how much money is on it, and write it back, giving themselves a huge balance.

What is Crypto?

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

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.