Documenting the proposal for TPM 2.0 security in the face of bus interposer attacks
James Bottomley
James.Bottomley at HansenPartnership.com
Mon Nov 19 20:20:39 UTC 2018
On Mon, 2018-11-19 at 13:05 -0700, Jason Gunthorpe wrote:
> On Mon, Nov 19, 2018 at 09:34:04AM -0800, James Bottomley wrote:
>
> > The current state of the art for snooping the TPM Genie hardware
> > interposer https://www.nccgroup.trust/us/our-research/tpm-genie/
> > which
> > is a simple external device that can be installed in a couple of
> > seconds on any system or laptop. However, the next phase of
> > research
> > seems to be hacking existing devices on the bus to act as
> > interposers,
> > so the fact that the attacker requires physical access for a few
> > seconds might evaporate. However, the goal of this document is to
> > protect TPM secrets and integrity as far as we are able in this
> > environment and to try to insure that if we can't prevent the
> > attack
> > then at least we can detect it.
> >
> > Unfortunately, most of the TPM functionality, including the
> > hardware
> > reset capability can be controlled by an attacker who has access to
> > the bus, so we'll discuss some of the disruption possibilities
> > below.
> >
> > Measurement (PCR) Integrity
> >
> > Since the attacker can send their own commands to the TPM, they can
> > send arbitrary PCR extends and thus disrupt the measurement system,
> > which would be an annoying denial of service attack. However,
> > there
> > are two, more serious, classes of attack aimed at entities sealed
> > to
> > trust measurements.
> >
> > 1. The attacker could intercept all PCR extends coming from the
> > system
> > and completely substitute their own values, producing a replay
> > of
> > an untampered state that would cause PCR measurements to attest
> > to
> > a trusted state and release secrets
> >
> > 2. At some point in time the attacker could reset the TPM, clearing
> > the PCRs and then send down their own measurements which would
> > effectively overwrite the boot time measurements the TPM has
> > already done.
>
> I can just de-solder the TPM, attach it to a rig and do whatever I
> want to it, including fake PCR loads and trigger seal/uneal of any
> data I like.
You wouldn't be able to resolder the TPM without causing a reset and
losing the PCR values.
The TPM is not designed to be secure against physical attacks that go
after its internal seed values, that's true. It is supposed to be
secure against attacks that go after the information transmission into
and out of the TPM, which is what the interposer is doing ... it's just
far lower in the stack than we were expecting.
> The promise of the TPM was never that PCR protected elements would be
> secure against something that has control over the physical hardware
> bus.
I agree as I say ... all we can guarantee is that our extensions go to
the PCRs or we see an error ... we can't guarantee the integrity of the
final measurements because the attacker can still have undetectably
added their own PCR extensions.
> The treat model for PCR users always contained the implicit
> assumption that the security of the physical TPM HW, and the secure
> linkage to the CPU (ie secure control over reset, and other things)
> is maintained.
>
> So, I'm not sure adding more crypto here really fits with the threat
> model the TPM lives in?
It is, because the attack is a man in the middle, even if it's at the
bus level, which TPM crypto and HMAC is supposed to thwart. For the
PCR case I just care about forcing our measurements or detecting their
loss ... that's good enough, I think because it means that the attacker
can disrupt the TPM measurements but can't set them to expected values
which is a reasonable thing to guarantee if we do secrets sealing to
PCR values.
> That said, certainly there are other non-PCR use cases where this
> stuff becomes important. For instance anything using shared secrets
> should absolutely establish a crypto unsnoopable path to the TPM.
>
> > Certain information passing in and out of the TPM, such as key
> > sealing and private key import and random number generation, is
> > vulnerable to interception which HMAC protection alone cannot
> > protect, so for these types of command we must also employ request
> > and response encryption to prevent the loss of secret information.
>
> Thwarting passive observation seems like a reasonable goal to
> me. Attaching a snooper has much less invasion and risk than doing
> something active.
>
> But I'm not sure the complexity of a null key is needed here? Won't
> any readable key in the TPM do this job?
In theory, but we don't seem to have one. The theory is that TPMs come
provisioned according to the TCG guidance which specifies RSA and
EC storage keys be at 81000001 and 81000002 respectively ... it just
seems that the current TPM generation don't respect this, so they come
with no permanent keys at all.
Since we have to derive a primary key anyway, the null seed seems more
useful because of the reset detection.
James
More information about the Linux-security-module-archive
mailing list