-
Notifications
You must be signed in to change notification settings - Fork 37
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
documented default PCRs don't match actual default PCRs #90
Comments
Good point! I don't think we want PCR 6 because this register measures every suspend to disk event (and fails to calculate the TOTP afterwards accordingly), which I don't think is useful. |
Not sure, but I believe one could argue, that
S4 / suspend-to-disk may be marginally better if one has an encrypted and authenticated resume image / swap, but still potentially problematic. (But not sure, if S4 resume is identical to normal boot with respect to TPM measurements - I hope so.) |
I'd argue that if an attacker is able to physically manipulate the hardware (as opposed to "just" having physical access without tampering with it), the security that tpm2-totp (and the TPM measured boot as a whole) provides goes out of the window anyway: after all, an attacker could simply talk to the TPM directly outside of the control of the operating system and provide the correct PCR measurements (to e.g. precalculate a large number of TOTPs). Anyway, if I understand the TCG PC Client Specific Implementation Specification correctly, suspend-to-ram isn't covered by PCR 6 anyway:
YMMV of course, that's why the PCR selection is configurable, but I don't think having PCR 6 as a default for all users is hugely beneficial, the main problem being that it is very confusing when the TOTP doesn't work any more after a suspend-to-disk for no apparent reason.
I must admit I haven't checked whether an S4 event is actually measured into PCR 6: on Linux, hibernation is basically a full shutdown, and when you turn the device back on, the RAM image is loaded from swap after a normal boot process. I'm not sure whether the operating system communicates to the firmware that this is a S4 instead of a "normal" shutdown. |
Hmm, I'd say all threat models that
Yeah, I had already thought about that (the whole 'untrusted time' / pre-computation issue) and wanted to propose an additional feature anyways. Alternatively, one could allow passing an arbitrary, unique timestamp into the TOTP calculation, making it a true challenge-response type authentication. But that would complicate usage with off-the-shelf mobile or token authenticators. The possibility of a relay attack (i.e. you are presented with a mockup, while the attacker is in possession of the actual hardware) is still open, but has to be considered out-of-scope for the time being and under the current threat model.
Hmm, will test that when I have time -
Will try to verify as well.
Good point, though I'm not sure what's the better tradeoff - user confusion vs. invisible attack vectors :/ |
The thing is, it's really hard to create a sensible threat model once hardware manipulation in any form is on the table: I don't think there's e.g. a real way to protect against a "buy a completely identical device to the one you want to attack, steal the original device and replace it with the copy, setup the copy to relay the screen of the original device to trick the user into unlocking it" scenario. Clearly that's a bit ridiculous, but it's really hard to know where to stop...
Yeah, I think this would be a useful (optional) feature indeed! Shouldn't be too difficult to implement from the TPM perspective, though obtaining user input within the initramfs might be a bit of a pain.
FWIW, I think some Nitrokeys have something similar: IIUC, they do a challenge-response using HOTP where the Nitrokey checks the response and flashes its LED light accordingly. It's a bit different than what you propose because the HOTP input cannot be considered secret, but could be easily modified to use a randomly generated input as the challenge. This would also take care of replay attacks.
That would be awesome! Come to think of it, if PCR 6 only includes suspend to disk, I would be open to having it in the default PCR selection: not every system is guaranteed to have encrypted swap, and replacing the resume image is very easy, so maybe it's better after all to enable PCR 6 by default (and therefore fail attestation after hibernation), unless users actively want to disable it (because they have setup encrypted swap, or don't need the additional security guarantee). |
actual default PCRs:
0,2,4
heredocumented default PCRs:
0,2,4,6
here and hereIn other places, the actual
0,2,4
is documented.Which ones should it be?
The text was updated successfully, but these errors were encountered: