September 3rd, 2024

EUCLEAK Side-Channel Attack on the YubiKey 5 Series

A study revealed a side-channel vulnerability in Infineon Technologies' cryptographic library, affecting YubiKey 5 Series devices below firmware 5.7. A patch exists, but certification is pending.

Read original articleLink Icon
ConcernFrustrationSkepticism
EUCLEAK Side-Channel Attack on the YubiKey 5 Series

A recent study by NinjaLab has revealed a significant side-channel vulnerability in the cryptographic library of Infineon Technologies, affecting various secure elements, including the widely used YubiKey 5 Series. Secure elements are microcontrollers designed for secure key storage and cryptographic operations, often deemed invulnerable due to rigorous security evaluations. The vulnerability, which has remained unnoticed for 14 years, stems from a non-constant-time modular inversion in the ECDSA implementation. This flaw allows attackers with physical access to the device to extract the ECDSA secret key through local electromagnetic side-channel acquisitions. All YubiKey 5 Series devices with firmware versions below 5.7 are impacted, as well as all Infineon security microcontrollers utilizing the Infineon cryptographic library. The study emphasizes that while the EUCLEAK attack requires specialized equipment and skills, using YubiKeys remains safer than not using any hardware authentication token at all. Infineon has developed a patch for the cryptographic library, but it has not yet undergone Common Criteria certification. A firmware update for YubiKey 5 Series is expected to transition to a new cryptographic library that is not affected by this vulnerability.

- A side-channel vulnerability in Infineon's cryptographic library has been discovered.

- The vulnerability affects all YubiKey 5 Series devices with firmware versions below 5.7.

- Physical access to the device is required to exploit the vulnerability.

- Infineon has a patch available, but it has not yet passed certification.

- A firmware update for YubiKey is expected to mitigate the issue.

AI: What people are saying
The comments on the article about the YubiKey vulnerability reveal several key concerns and themes among users.
  • Many users express frustration over the difficulty of replacing vulnerable YubiKeys, as it requires manual updates across multiple accounts.
  • There is a significant concern regarding the physical security of YubiKeys, with discussions about the potential for attackers to swap devices unnoticed.
  • Users highlight the implications of the vulnerability on FIDO attestation and the need for better design to resist cloning attacks.
  • Some commenters question the effectiveness of the proposed patch and the decision to switch to a custom cryptographic library.
  • Several users share their strategies for managing multiple YubiKeys and keeping track of where they are used.
Link Icon 51 comments
By @edent - 5 months
As per https://arstechnica.com/security/2024/09/yubikeys-are-vulner...

An attacker not only needs your username and password, they also need physical access to your key. They then have to disassemble the device. If they want to give it back to you, they'll need to reassemble it.

So not exactly trivial!

A blob of nail-varnish over a plastic seam might be a useful canary.

But this does highlight one weakness of these FIDO tokens - you have to manually maintain a list of where you've registered them. And if your token is lost or stolen, you have to manually revoke every single one.

By @OptionOfT - 5 months
I think the most annoying part of this is that you cannot just replace a YubiKey.

Regardless of whether you're using passkeys or the non-discoverable ones, you need to manually go through each account and replace the YubiKey with a non-vulnerable key before decommissioning this one.

And then there is the non-discoverable part. I don't remember where I've used my YubiKey in the past.

Also, on the Ars article [0] there is mention of a PIN:

> YubiKeys provide optional user authentication protections, including the requirement for a user-supplied PIN code or a fingerprint or face scan.

This is not a YubiKey thing, but a FIDO thing [1].

[0]: https://arstechnica.com/security/2024/09/yubikeys-are-vulner...

[1]: https://new.reddit.com/r/yubikey/comments/12bv4sv/fido_pin_s...

By @xyst - 5 months
> All YubiKey 5 Series (with firmware version below 5.7) are impacted by the attack …

Oh, so I just need to update the firmware on the physical hardware token.

> YubiKey Firmware is Not Upgradable

https://support.yubico.com/hc/en-us/articles/360013708760-Yu...

L. So, Yubico is providing _free_ replacements, right?

I have a handful of these Yubikeys…

By @londons_explore - 5 months
> due to a non constant-time modular inversion.

That isn't exactly some subtle side channel involving tiny emissions of radio waves... The time depending on the secret data is pretty much the first thing that any side channel audit ought to check.

It's super simple too - simply verify that all operations always take the same number of clock cycles, no matter the data. Errors too - they should always be thrown after a fixed number of clock cycles, independent of the data.

How did auditors miss this?

By @gwbas1c - 5 months
> primary goal is to fight the scourge of phishing attacks. The EUCLEAK attack requires physical access to the device

Something to consider: If someone is going to go through the effort to get physical access to a Yubikey, they only need to swap it with one that has a similar level of wear and a similar appearance. At that point, the victim will merely believe that their Yubikey is broken; and/or the attacker will have enough time to use the Yubikey.

For example, I have two Yubikeys. Someone could sneak into my house, swap my spare, and I wouldn't figure it out until I go to use my spare.

Basically: This attack is only "worth it" if your target is so valuable that you can target them in person. At that point, I'd think the target would use something a little more secure than a Yubikey.

By @shellcromancer - 5 months
Fantastic research by NinjaLab. One of the most interesting parts to me from Yubico's advisory is that the Webauthn protocols attestation [1] is also defeated by this local cloning. Could the protocol have been better designed to resist this local cloning attack?

> An attacker could exploit this issue to create a fraudulent YubiKey using the recovered attestation key. This would produce a valid FIDO attestation statement during the make credential resulting in a bypass of an organization’s authenticator model preference controls for affected YubiKey versions.

1. https://www.w3.org/TR/webauthn-2/#attestation

By @traceroute66 - 5 months
I see the Yubico website says 5.7 or greater not affected.

Elsewhere on the Yubico website[1] they state that a feature of 5.7 release was ...

    Migration to Yubico’s own cryptographic library that performs the underlying cryptographic operations (decryption, signing, etc.) for RSA and ECC
Hopefully they've had lots of eyes looking at that ! Not sure why anybody feels the need to write their own crypto libraries these days, there are so many implementations out there, both open and closed source.

[1] https://www.yubico.com/blog/now-available-for-purchase-yubik...

By @mcwhy - 5 months
Infenion strikes again, 7 years ago: https://en.wikipedia.org/wiki/ROCA_vulnerability
By @tptacek - 5 months
3. Infineon has already a patch for their cryptographic library, to our knowledge it did not yet pass a Common Criteria certification evaluation.

For what it's worth: this doesn't matter even a little bit.

By @bangaladore - 5 months
Additionally, it looks like this vulnerability exist on on all Infineon trusted X (platform modules, microcontrollers, etc...) that use the same internal crypto libraries.
By @nabla9 - 5 months
Daniel J. Bernstein https://mathstodon.xyz/@djb@cr.yp.to/113079723152809027

> Some tools at different layers that would have stopped timing attacks against ECDSA nonce-inversion software: (1) the safegcd algorithm, https://gcd.cr.yp.to; (2) switching from ECDSA to EdDSA, typically Ed25519; (3) using TIMECOP (https://bench.cr.yp.to/tips.html#timecop) to scan for leaks.

By @lxgr - 5 months
Does anybody know if plain ECDH (as used by e.g. ICAO biometric passports implementing PACE) or Ed25519 (assuming Infineon's chips/libraries implement that) are impacted?

The paper specifically calls out PACE as also using modular inversion, but I don't understand either that or Ed25519 enough to get a sense for how bad this is for algorithms beyond just ECDSA.

By @tommiegannert - 5 months
> The new YubiKey firmware 5.7 update (May 6th, 2024) switches the YubiKeys from Infineon cryptographic library to Yubico new cryptographic library. To our knowledge, this new cryptographic library is not impacted by our work.

Found vuln in library used by many for 14 years. Solution: switch to custom code. That's a bold strategy. I hope it pays off.

> Infineon has already a patch for their cryptographic library [---]

By @TavsiE9s - 5 months
Does not sound like they're issuing replacement devices.
By @jacekm - 5 months
If you have a Yubi Key and you are worried, read this part from their report:

> the adversary needs to open the device (...) Then the device must be re-packaged and quietly returned to the legitimate user (...) assuming one can find a reliable way to open and close the device, we did not work on this part

Yubi Keys are supposed to be tamper-evident and you can also put tamper-evident stickers on them. I am more concerned that a determined attacker may eventually find a way to record the signals without having to remove the casing.

By @alienchow - 5 months
This requires the attacker to steal your key. When that happens, by the time they can get the secret key I've already revoked it.

The biggest problem with FIDO keys isn't the fact that people can gain access to your accounts if it's physically stolen.

I have redundant keys for backup access. But I have no idea which accounts I used the lost key for, in order to log into them one by one to revoke the key.

How does everyone here keep track? A post-it note in the cookie jar?

By @create-username - 5 months
I’ve created two TOTP 2FA on two different YubiKeys. During the TOPT configuration process, the website gives me a password that I enter on the YubiKey configuration app.

Then, I do not store that password. But if I stored it on Bitwarden, I could easily create a YubiKey backup or set it on another app like ente.

I have not kept that password because I considered that it could be easily compromise my security. I have kept the backup codes nonetheless.

Should I keep the TOTP configuration password that the website gives me when I tell it that I cannot scan the QR code?

By @nullc - 5 months
It's really easy to blind a variable time modular inverse, assuming you have a random number generator handy: you want the inverse of x, compute instead the inverse of x*r, then multiply the result with r.

So I wonder if some things using the same chip/library are not actually vulnerable because they blinded the operation?

It's *better* to use a constant time algorithm, but that's harder to do in a curve generic way and has a pretty significant performance impact (particular before the safegcd paper).

By @noodlesUK - 5 months
From a practical perspective, what protection does the use of a fido2 PIN provide here? Is the EM side channel exposed without knowledge of the PIN?

In any case this is a tremendous attack, good job!

By @Arch-TK - 5 months
Don't have high hopes for this but I just requested a replacement device through their support system as the offered mitigations are not something I would like to consider.
By @klaussilveira - 5 months
Subdermal Yubikey when?
By @gatestone - 5 months
Can you explain me, why do you need to be online to extract the private key? Can't you just steal the token, input the nonces offline, and meter timing? Then, crunch out the private key, and only then, if needed, phish the password?
By @jenny91 - 5 months
You have to practically destroy the YubiKey in the process of extracting the secret, however.
By @globalise83 - 5 months
Infineon is a listed company, not sure how much news will be published on this before German and Austrian markets open in a couple of hours so could be a profitable short selling opportunity.
By @rasengan0 - 5 months
gotta bunch of yubis and was about to ask about https://store.google.com/product/titan_security_key then found https://ninjalab.io/a-side-journey-to-titan/ by the same folks
By @altairprime - 5 months
> YubiEnterprise Subscription customers can leverage their available replacement entitlements to receive YubiKeys with the new firmware.
By @jwr - 5 months
Good thing I use my YubiKeys with RSA keys, protected with a PIN, following the most excellent guide by DrDuh.
By @wkat4242 - 5 months
Huh I thought they used an NXP secure element.

But I see now that was the yubikey neo, the 5 is Indeed infineon

By @tomas789 - 5 months
> This vulnerability – that went unnoticed for 14 years and about 80 highest-level Common Criteria certification evaluations

This is yet another example of why you don’t f around with crypto and auth in general. Just use best practices and you might be OK.

By @AdmiralAsshat - 5 months
Did they verify whether older keys are vulnerable, or did they not bother to test?
By @visualblind - 5 months
Looks like the site is down. Appears to be a VPS on Ghandi's platform.
By @rpncreator - 5 months
TIL you need to update the firmware on Yubikeys.
By @hacker_88 - 5 months
The happiest are Hollywood writers .
By @ycombinatrix - 5 months
i guess this breaks fido attestation for a lot of use cases since most yubikeys can be spoofed now
By @nicman23 - 5 months
really never got the whole concept of what is basically is a tpm that advertises "money here"

software otp in a phone or something that is able to be updated seems to be a better choice

By @jcfrei - 5 months
FYI: This page gets stuck at 99% on firefox (130.0).