Skip to content
Crypto Write-up Advanced

Tap to Exploit: Analyzing and Manipulating Mastercard Contactless

The researcher found that a Mastercard contactless chip accepts and signs terminal-declared cardholder verification results without any independent check, and that a man-in-the-middle can alter those fields so the chip still returns a valid cryptogram. A compromised or modified terminal could therefore declare a PIN was verified when it was not, leaving detection entirely to the issuer's backend.

Davi Moura Follow

Published on medium.com

Mastercard contactless transactions are part of our daily lives. Tap, beep, done.

Davi Moura, on medium.com

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 chip treats terminal-supplied cardholder verification fields as trusted input and does not cross-check them against other fields in the same command before generating the cryptogram.

Impact

A tampered terminal or relay could obtain a valid cryptogram for a transaction where no PIN was entered, and the chip would not flag the contradiction, so only the issuer's backend could catch it.

What the attacker needed

Physical control of terminal or NFC relay; victim card present at the terminal; offline data authentication disabled

The fix

The chip should cross-validate terminal-declared verification fields against each other and decline to a rejection cryptogram when they contradict, rather than relying on the backend alone.

How it was found

  1. Set up a man-in-the-middle between the terminal and the card using NFC relay tooling.
  2. Let the terminal run the normal flow and request the PIN.
  3. Intercept the Generate AC command and replace the cardholder verification result bytes with a no-verification value.
  4. Forward the altered command to the chip and observe that it still returns a valid cryptogram.

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.

When you tap a card, the payment terminal tells the chip what happened, including whether you entered a PIN. This research shows the chip simply believes that statement and signs the transaction, so a tampered terminal can claim a PIN was checked when it was not. The bank's backend is then the only place that could notice the lie.

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.