-
-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade from v6.0 to v6.2 broke pam u2f #91
Comments
Can you provide steps to reproduce it and logs? |
Debian GNU/Linux 12 + backports + backported pam- Raspberry Pi Pico Zero RP2040 + Pico Fido.
pico-fido-6.0-after-unplug.log PS: I just found out that if a newly programmed Pico Key 6.2 does not have a PIN set (e.g. via fido2-token -S /dev/hidrawN), it works after unplugging it from USB and plugging it in back. After setting the PIN, it behaves as described above and see the logs. Strange. |
Backported pam-u2f 1.3.2 same issue. |
Can you test with the last development version? There was an issue with linux, OTP and PCSC interfaces #96. You can build it yourself or wait til tomorrow and use the nightly development build. |
TL;DR See #54 for an explanation. |
Forcing pin verification isn't solution, because I don't want to use it. I only want user presence verification (by touching key / pressing button). Original keys from various manufacturers work the same way. (Btw. pinverification is configurable by pamu2cfg, see parameter -N, --pin-verification Require PIN verification during authentication, so every user can configure how he want to be verified with his key, don't need to set it in system PAM config). Firmware 6.0 works well with it too. |
It's hard to solve. If you don't want PIN verification, then your keys can be dumped really easy. Dumping the flash memory is something straightforward. Thus, I must encrypt the key material with an external key provided by the user, i.e., a PIN. IMHO, the purpose of having a FIDO key is to make more robust authentication problems; it's not having a button to log in without any password or PIN, which is a terrible security flaw btw. |
I understand. Thanks for clarification.
Anyone is who? User that has physical access to my Pico key? Or application? Dumping has to be runned by somebody. How?
So why entering PIN is not necessary until unplug key from USB? Does that mean, that dumping keys is possible on 6.2 too?
Other manufacturers of security keys has this problem too or this is problem only for Fido keys? So best solution will be HW with integrated biometric. Hm... |
The flash can be dumped putting your board in BOOTSEL mode, like you did to flash the firmware, and with Other vendors assume the ROM cannot be tampered, relying in the hardware to protect the key material. But if someone finds an exploit (like in the past), then all sold boards are vulnerable by design. RP2350 has a security hardware but it was violated few weeks ago. Pico Keys are not directly affected due to the encryption of the content. But then it requires a robust user input. When you enter the PIN, a hash of it is stored in the RAM, which is used to decrypt the content when needed. If you reboot, the session is clreared and thus it must be entered again. The session however is cleared every 10 minutes of inactivity as stated by FIDO specs. |
It is very difficult to ensure that any security device cannot be misused if you gain physical access to it. This is a generally known principle. But gaining physical access may not be a simple matter. If I gain physical access to a device such as the RP2040, I do not expect that it will not be misused, it must be assumed that it has been or will be misused. In such a case, it is necessary to replace the "lock in the door and thereby invalidate the original keys".
So physical access to my device is needed. There is no possibility without it, right? I treat my keys in a way that no one else can physically access them. It doesn't matter if it's an electronic gadget or a regular door lock key, etc.
So, security through obscurity. This is not actually secure. Regarding the RP2350, I wrote above.
So dumping is possible after first PIN input is provided, because information is decrypted and situation is same from this moment like in FW 6.0, but it's in 10 mins window only? Thanks for your explanation, it is very informative. |
I tested FW 6.2 now with pinverification=1 forced in pam config, but behavior is same as without PIN verification. After unplug / plug device it stops working until I again run pamu2fcfg, then works again until next unplug / plug Pico Key. And so on and on. So this solution won't help. Nightly build isn't available still. I can test it when be available or I build own, later. |
RP2350 is in its early stage and these issues will be solved in next revisions. They will be more robust but I will not leverage new enhancements to transfer security aspects; so I’d rather prefer continue encrypting the flash for a matter of design. If the flash is outside the die anyone can probe the bus between the MCU and the flash. If the communication bus is encrypted, then I could start thinking on new architectures but this is something I will not expect in the mid term. “ So dumping is possible after first PIN input is provided, because information is decrypted and situation is same from this moment like in FW 6.0, but it's in 10 mins window only?” No, this is not how it works. Flash is always encrypted. When a user key has to be retrieved, the portion of the key material is decryptes onto RAM and cleared before the function returns. The key for decryption is taken from a volatile hash of the PIN. This hash is cleared after 10 minutes of inactivity. But in the meantime, the keys can be retrieved by the firmware but nothing else. To dump the flash you must reboot the board, which clears the RAM. An attacker will get an encrypted content without a key. Edit: I tested Here's an interesting paper describing an attack by exploiting consecutive silent authentications: |
After upgrade key to v6.2 pam u2f not working if key is unplugged from USB and plugged again. If new configuration is generated via pamu2fcfg, then auth working again, until key is unplugged and plugged to USB.
Debugging pam module says (after USB replug):
"Device for this keyhandle is not present"
The text was updated successfully, but these errors were encountered: