Skip to content
Crypto Write-up Intermediate

The Full Story

The NHS COVID-19 Android app used signed JWT tokens for venue check-in QR codes but called a JWT library method that did not verify the signature, so an attacker could forge a QR code with an unsigned token and a valid key identifier. This allowed fake venue check-ins to be accepted by the app.

zofrex.com

Published on zofrex.com

Due to the nature of the app here, I want to start this blog post with a disclaimer:

zofrex, on zofrex.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 Android app called a generic JWT parsing method that does not enforce signature verification, instead of the library's method specifically for signed tokens.

Impact

Anyone could have forged venue QR codes and checked in to arbitrary venues, though the author states this had no privacy impact and did not affect the app's core function.

What the attacker needed

Ability to create a QR code; knowledge of the correct key identifier; victim scans the forged QR code

The fix

The vulnerability was fixed by the NHS team after being reported.

How it was found

  1. Read the open-source Android app code and find the QR code parser.
  2. Notice that the parser calls a generic JWT parse method rather than the signed-token-specific method.
  3. Set up a local test harness with the same parser code and a made-up signing key.
  4. Generate a JWT with the 'none' algorithm and a payload resembling a real venue check-in.
  5. Run the forged token through the parser and observe that it is accepted without a valid signature.

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 JWT is a small piece of data that can carry a digital signature, like a wax seal, to prove it was made by a trusted party. The app was supposed to check that seal before trusting the venue details inside, but it used a library function that skipped the check. That meant someone could make their own QR code with no seal at all and the app would still accept it.

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.