Skip to contentSkip to conversation

How can I prevent MITM attacks for unsealing?

tpm2 joseph at zeronsoftn.com 1 participant 10 messages Oct 3, 2022 – Oct 24, 2022

lore
Share & tools
lore

joseph at zeronsoftn.com

#0 lore raw

Hello,
Does anyone know about this issue?
https://github.com/jc-lab/securekit/blob/466abe16bfe4f28ef86db6bc72649214ab2e4b51/pkg/securekit-disk/opt/securekit/sbin/disk-init#L82-L86
Here's one example of sealing and unsealing.
This method seems (probably?) to prevent the sniffing attack, which was a vulnerability of Bitlocker in the past.
But isn't a MITM attack possible in the process of creating an encrypted session?
I am not familiar with the process of establishing a session,
However, it seems that MITM can be prevented only by using a session key encrypted with the EK of the TPM, or by signing the asymmetric key with the EK to derive the key, when creating a session. Is MITM not considered in TPM? Or is there another way?
Regards,

#1 lore raw
Quoted 4 lines · joseph(a)zeronsoftn.com

Hello,

Does anyone know about this issue?

Quoted 8 lines

https://github.com/jc-lab/securekit/blob/466abe16bfe4f28ef86db6bc72649214ab2e4b51/pkg/securekit-disk/opt/securekit/sbin/disk-init#L82-L86

Here's one example of sealing and unsealing.
This method seems (probably?) to prevent the sniffing attack, which was a vulnerability of Bitlocker in the past.

But isn't a MITM attack possible in the process of creating an encrypted session?

So just to unpack the commands here for discussion I copied that code block:

tpm2_createprimary -Q -C o -c tpm-primary.ctx tpm2_load -Q -C tpm-primary.ctx -u ${p1_dir}/seal.pub -r ${p1_dir}/seal.priv -c tpm-seal.ctx tpm2_startauthsession -Q --hmac-session -c tpm-primary.ctx -S session.ctx
tpm2_unseal -Q -p pcr:${tpm_seal_pcr_policy} -c tpm-seal.ctx -o ${output}
cleanupSession

The issue here is that the key created by the tpm2_createprimary command doesn't have provenance, so it's just be trusted implicitly even through it could be attacker controlled. If the attacker was controlling the primary object, they could just forward the commands unencrypted to the TPM and get the unseal to release them the key in the clear.

Quoted 5 lines

I am not familiar with the process of establishing a session, However, it seems that MITM can be prevented only by using a session key encrypted with the EK of the TPM, or by signing the asymmetric key with the EK to derive the key, when creating a session.

You just need a way to ensure provenance. Another way is to load an established key to the TPM and start the authsession with that. If you're using a persistent key you need to verify the name after establishing the session or use something like a serialized ESYS_TR which will do the name checking automatically. If you load a key blob to the TPM that you control, ESAPI will have the checks in place to make sure you don't get duped.

Quoted 2 lines

Is MITM not considered in TPM? Or is there another way?

It is considered in the TPM and is discussed in the architecture document. Theirs a few ways you can securely set up an encrypted session, either with EK and associated Certificate or through other keys like the SRK. The big thing is, you have to do it in a way where the attacker can not MiTM the session establishment, which boils down to using a known key.

Quoted 11 lines

Regards,

_______________________________________________
tpm2 mailing list -- tpm2(a)lists.01.org
To unsubscribe send an email to tpm2-leave(a)lists.01.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

#2 lore raw
Quoted 47 lines · William C
Quoted 4 lines · joseph(a)zeronsoftn.com

Hello,

Does anyone know about this issue?

Quoted 8 lines

https://github.com/jc-lab/securekit/blob/466abe16bfe4f28ef86db6bc72649214ab2e4b51/pkg/securekit-disk/opt/securekit/sbin/disk-init#L82-L86

Here's one example of sealing and unsealing.
This method seems (probably?) to prevent the sniffing attack, which was a vulnerability of Bitlocker in the past.

But isn't a MITM attack possible in the process of creating an encrypted session?

So just to unpack the commands here for discussion I copied that code block:

tpm2_createprimary -Q -C o -c tpm-primary.ctx tpm2_load -Q -C tpm-primary.ctx -u ${p1_dir}/seal.pub -r ${p1_dir}/seal.priv -c tpm-seal.ctx tpm2_startauthsession -Q --hmac-session -c tpm-primary.ctx -S session.ctx
tpm2_unseal -Q -p pcr:${tpm_seal_pcr_policy} -c tpm-seal.ctx -o ${output}
cleanupSession

The issue here is that the key created by the tpm2_createprimary command doesn't have provenance, so it's just be trusted implicitly even through it could be attacker controlled. If the attacker was controlling the primary object, they could just forward the commands unencrypted to the TPM and get the unseal to release them the key in the clear.

Quoted 5 lines

I am not familiar with the process of establishing a session, However, it seems that MITM can be prevented only by using a session
key encrypted with the EK of the TPM, or by signing the asymmetric key with the EK to derive the key, when creating a session.

You just need a way to ensure provenance. Another way is to load an established key to the TPM and start the authsession with that. If you're using a persistent key you need to verify the name after establishing the session or use something like a serialized ESYS_TR which will do the name checking automatically. If you load a key blob to the TPM that you control, ESAPI will have the checks in place to make sure you don't get duped.

Quoted 8 lines
Quoted 1 line

Is MITM not considered in TPM? Or is there another way?

It is considered in the TPM and is discussed in the architecture document. Theirs a few ways you can securely set up an encrypted session, either with EK and associated Certificate or through other keys like the SRK. The big thing is, you have to do it in a way where the attacker can not MiTM the session establishment, which boils down to using a known key.

Actually the seem to be aware of this in their README:
https://github.com/jc-lab/securekit#do-not-use-yet

Quoted 15 lines
Quoted 11 lines

Regards,

_______________________________________________
tpm2 mailing list -- tpm2(a)lists.01.org
To unsubscribe send an email to tpm2-leave(a)lists.01.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

_______________________________________________
tpm2 mailing list -- tpm2(a)lists.01.org
To unsubscribe send an email to tpm2-leave(a)lists.01.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

#5 lore raw
In reply to Roberts

Here is the commands I tried:
https://gist.github.­com/jclab-joseph/d1d­6d9bbbd32c0fe200cc77­25bcf0d86
A session was estab­lished via a seriali­zed persistent handl­e.
This seems to be ab­le to prevent MITM in the session connection process.
But, assume that an attacker can modify the filesystem.
If the primary.handle can be replaced with the attacker's key, the session will be successfully established.
And I suspect that plaintext can be exposed if unsealed through the session.
Wouldn't validation be needed between the connected session and seal.ctx? 화요일, 04 10월 2022, 00:54오전 +09:00 발신 "Roberts, William C" william.c.roberts(a)intel.com :

Quoted 67 lines · joseph(a)zeronsoftn.com

Hello,

Does anyone know about this issue?

https://github.com/jc-lab/securekit/blob/466abe16bfe4f28ef86db6bc72649214ab2e4b51/pkg/securekit-disk/opt/securekit/sbin/disk-init#L82-L86

Here's one example of sealing and unsealing.
This method seems (probably?) to prevent the sniffing attack, which was a vulnerability of Bitlocker in the past.

But isn't a MITM attack possible in the process of creating an encrypted session?
So just to unpack the commands here for discussion I copied that code block:

tpm2_createprimary -Q -C o -c tpm-primary.ctx tpm2_load -Q -C tpm-primary.ctx -u ${p1_dir}/seal.pub -r ${p1_dir}/seal.priv -c tpm-seal.ctx tpm2_startauthsession -Q --hmac-session -c tpm-primary.ctx -S session.ctx
tpm2_unseal -Q -p pcr:${tpm_seal_pcr_policy} -c tpm-seal.ctx -o ${output}
cleanupSession

The issue here is that the key created by the tpm2_createprimary command doesn't have provenance, so it's just be trusted implicitly even through it could be attacker controlled. If the attacker was controlling the primary object, they could just forward the commands unencrypted to the TPM and get the unseal to release them the key in the clear.

I am not familiar with the process of establishing a session, However, it seems that MITM can be prevented only by using a session key encrypted with the EK of the TPM, or by signing the asymmetric key with the EK to derive the key, when creating a session.

You just need a way to ensure provenance. Another way is to load an established key to the TPM and start the authsession with that. If you're using a persistent key you need to verify the name after establishing the session or use something like a serialized ESYS_TR which will do the name checking automatically. If you load a key blob to the TPM that you control, ESAPI will have the checks in place to make sure you don't get duped.

Is MITM not considered in TPM? Or is there another way?

It is considered in the TPM and is discussed in the architecture document. Theirs a few ways you can securely set up an encrypted session, either with EK and associated Certificate or through other keys like the SRK. The big thing is, you have to do it in a way where the attacker can not MiTM the session establishment, which boils down to using a known key.

Regards,

_______________________________________________
tpm2 mailing list -- tpm2(a)lists.01.org
To unsubscribe send an email to tpm2-leave(a)lists.01.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

#4 lore raw
In reply to joseph at zeronsoftn.com
Quoted 7 lines · joseph(a)zeronsoftn.com

Here is the command I tested:
https://gist.github.com/jclab-joseph/d1d6d9bbbd32c0fe200cc7725bcf0d86
A session was established via a serialized persistent handle. This seems to be able to prevent MITM by default.

But wouldn't it still be vulnerable if an attacker could replace primary.handle?

You can think of this as the same attack as replacing your root CA certs for your browser. If an attacker can modify or add a Root CA they can get you to trust them (the attacker). Same here, if the metadata your validating against changes, ie the public key, then you lost.

Quoted 1 line

Is there a way to validate between session and seal.ctx or seal.pub?

The key blobs themselves are tamper resistant using an HMAC for integrity and AES128CFB for confidentiality.

Assuming you seal and unseal with a session started with a trusted key, then you're good. An attacker can only observer the traffic but cannot modify or extract the data on the bus if encrypted sessions are used.

You could also use or add a bind key to the session where the objects password is used in the generation of the session key. This bind key could be the password used on the seal key if the seal key has a password.

Quoted 4 lines

_______________________________________________
tpm2 mailing list -- tpm2(a)lists.01.org
To unsubscribe send an email to tpm2-leave(a)lists.01.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

#6 lore raw
In reply to joseph at zeronsoftn.com
Quoted 7 lines · joseph(a)zeronsoftn.com

Here is the commands I tried:
https://gist.github.­com/jclab-joseph/d1d­6d9bbbd32c0fe200cc77­25bcf0d86
A session was estab­lished via a seriali­zed persistent handl­e. This seems to be ab­le to prevent MITM in the session connection process.

Quoted 8 lines

But, assume that an attacker can modify the filesystem. If the primary.handle can be replaced with the attacker's key, the session will be successfully established.
And I suspect that plaintext can be exposed if unsealed through the session.

Wouldn't validation be needed between the connected session and seal.ctx?

If the attacker can modify the primary.handle, which is verifying the encrypted session, then yes you need something else. You could add a bind key with a password and have the user enter the password and thus nothing for the attacker to attack that is stored on disk.

Quoted 84 lines

화요일, 04 10월 2022, 00:54오전 +09:00 발신 "Roberts, William C" william.c.roberts(a)intel.com:

Quoted 77 lines · joseph(a)zeronsoftn.com
Quoted 5 lines

Hello,

Does anyone know about this issue?

https://github.com/jc-lab/securekit/blob/466abe16bfe4f28ef86db6bc72649214ab2e4b51/pkg/securekit-disk/opt/securekit/sbin/disk-init#L82-L86

Quoted 3 lines

Here's one example of sealing and unsealing.
This method seems (probably?) to prevent the sniffing attack,

which

Quoted 4 lines

was a vulnerability of Bitlocker in the past.

But isn't a MITM attack possible in the process of creating an encrypted session?

So just to unpack the commands here for discussion I copied that code
block:

tpm2_createprimary -Q -C o -c tpm-primary.ctx tpm2_load -Q -C tpm-primary.ctx -u ${p1_dir}/seal.pub -r ${p1_dir}/seal.priv -c tpm-seal.ctx tpm2_startauthsession -Q --hmac-session -c tpm-primary.ctx -S session.ctx
tpm2_unseal -Q -p pcr:${tpm_seal_pcr_policy} -c tpm-seal.ctx -o ${output}
cleanupSession

The issue here is that the key created by the tpm2_createprimary command doesn't have provenance, so it's just be trusted implicitly even through it could be attacker controlled. If the attacker was controlling the primary object, they could just forward the commands
unencrypted to the TPM and get the unseal to release them the key in
the clear.

Quoted 3 lines

I am not familiar with the process of establishing a session, However, it seems that MITM can be prevented only by using a

session

Quoted 1 line

key encrypted with the EK of the TPM, or by signing the

asymmetric

Quoted 1 line

key with the EK to derive the key, when creating a session.

You just need a way to ensure provenance. Another way is to load an established key to the TPM and start the authsession with that. If you're using a persistent key you need to verify the name after establishing the session or use something like a serialized ESYS_TR which will do the name checking automatically. If you load a key blob
to the TPM that you control, ESAPI will have the checks in place to make sure you don't get duped.

Quoted 2 lines

Is MITM not considered in TPM? Or is there another way?

It is considered in the TPM and is discussed in the architecture document. Theirs a few ways you can securely set up an encrypted session, either with EK and associated Certificate or through other keys like the SRK. The big thing is, you have to do it in a way where
the attacker can not MiTM the session establishment, which boils down
to using a known key.

Quoted 11 lines

Regards,

_______________________________________________
tpm2 mailing list -- tpm2(a)lists.01.org
To unsubscribe send an email to tpm2-leave(a)lists.01.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

#7 lore raw

Serialized primary.handle has a Public Key.
Is there a way to verify whether this public key is a key created by the TPM through the TPM's EK?
If this is possible, it will not be possible to protect against MITM in general, but if you have the CA of specific TPM manufacturers safely or remotely verify it, can be defend against MITM. 토요일, 22 10월 2022, 02:43오전 +09:00 발신 "Roberts, William C" william.c.roberts(a)intel.com :

Quoted 105 lines · joseph(a)zeronsoftn.com

Here is the commands I tried:
https://gist.github.com/jclab-joseph/d1d6d9bbbd32c0fe200cc7725bcf0d86
A session was established via a serialized persistent handle. This seems to be able to prevent MITM in the session connection process.

But, assume that an attacker can modify the filesystem. If the primary.handle can be replaced with the attacker's key, the session will be successfully established.
And I suspect that plaintext can be exposed if unsealed through the session.

Wouldn't validation be needed between the connected session and seal.ctx?
If the attacker can modify the primary.handle, which is verifying the encrypted session, then yes you need something else. You could add a bind key with a password and have the user enter the password and thus nothing for the attacker to attack that is stored on disk.

화요일, 04 10월 2022, 00:54오전 +09:00 발신 "Roberts, William C" william.c.roberts(a)intel.com:

Quoted 77 lines · joseph(a)zeronsoftn.com
Quoted 5 lines

Hello,

Does anyone know about this issue?

https://github.com/jc-lab/securekit/blob/466abe16bfe4f28ef86db6bc72649214ab2e4b51/pkg/securekit-disk/opt/securekit/sbin/disk-init#L82-L86

Quoted 3 lines

Here's one example of sealing and unsealing.
This method seems (probably?) to prevent the sniffing attack,

which

Quoted 4 lines

was a vulnerability of Bitlocker in the past.

But isn't a MITM attack possible in the process of creating an encrypted session?

So just to unpack the commands here for discussion I copied that code
block:

tpm2_createprimary -Q -C o -c tpm-primary.ctx tpm2_load -Q -C tpm-primary.ctx -u ${p1_dir}/seal.pub -r ${p1_dir}/seal.priv -c tpm-seal.ctx tpm2_startauthsession -Q --hmac-session -c tpm-primary.ctx -S session.ctx
tpm2_unseal -Q -p pcr:${tpm_seal_pcr_policy} -c tpm-seal.ctx -o ${output}
cleanupSession

The issue here is that the key created by the tpm2_createprimary command doesn't have provenance, so it's just be trusted implicitly even through it could be attacker controlled. If the attacker was controlling the primary object, they could just forward the commands
unencrypted to the TPM and get the unseal to release them the key in
the clear.

Quoted 3 lines

I am not familiar with the process of establishing a session, However, it seems that MITM can be prevented only by using a

session

Quoted 1 line

key encrypted with the EK of the TPM, or by signing the

asymmetric

Quoted 1 line

key with the EK to derive the key, when creating a session.

You just need a way to ensure provenance. Another way is to load an established key to the TPM and start the authsession with that. If you're using a persistent key you need to verify the name after establishing the session or use something like a serialized ESYS_TR which will do the name checking automatically. If you load a key blob
to the TPM that you control, ESAPI will have the checks in place to make sure you don't get duped.

Quoted 2 lines

Is MITM not considered in TPM? Or is there another way?

It is considered in the TPM and is discussed in the architecture document. Theirs a few ways you can securely set up an encrypted session, either with EK and associated Certificate or through other keys like the SRK. The big thing is, you have to do it in a way where
the attacker can not MiTM the session establishment, which boils down
to using a known key.

Quoted 11 lines

Regards,

_______________________________________________
tpm2 mailing list -- tpm2(a)lists.01.org
To unsubscribe send an email to tpm2-leave(a)lists.01.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

#8 lore raw

The TPM2_Cerify command can certify that another key is the TPM based on a key you trust, like the EK.

Bill
________________________________
From: joseph(a)zeronsoftn.com <joseph(a)zeronsoftn.com>
Sent: Friday, October 21, 2022 11:23 PM
To: Roberts, William C <william.c.roberts(a)intel.com>
Cc: tpm2(a)lists.01.org <tpm2(a)lists.01.org>
Subject: Re[5]: [tpm2] How can I prevent MITM attacks for unsealing?

Serialized primary.handle has a Public Key.
Is there a way to verify whether this public key is a key created by the TPM through the TPM's EK?

If this is possible, it will not be possible to protect against MITM in general, but if you have the CA of specific TPM manufacturers safely or remotely verify it, can be defend against MITM.

토요일, 22 10월 2022, 02:43오전 +09:00 발신 "Roberts, William C" william.c.roberts(a)intel.com<mailto:william.c.roberts(a)intel.com>:

Quoted 7 lines · joseph(a)zeronsoftn.com

Here is the commands I tried:
https://gist.github.com/jclab-joseph/d1d6d9bbbd32c0fe200cc7725bcf0d86
A session was established via a serialized persistent handle. This seems to be able to prevent MITM in the session connection process.

Quoted 8 lines

But, assume that an attacker can modify the filesystem. If the primary.handle can be replaced with the attacker's key, the session will be successfully established.
And I suspect that plaintext can be exposed if unsealed through the session.

Wouldn't validation be needed between the connected session and seal.ctx?

If the attacker can modify the primary.handle, which is verifying the encrypted session, then yes you need something else. You could add a bind key with a password and have the user enter the password and thus nothing for the attacker to attack that is stored on disk.

Quoted 84 lines

화요일, 04 10월 2022, 00:54오전 +09:00 발신 "Roberts, William C" william.c.roberts(a)intel.com:

Quoted 77 lines · joseph(a)zeronsoftn.com
Quoted 5 lines

Hello,

Does anyone know about this issue?

https://github.com/jc-lab/securekit/blob/466abe16bfe4f28ef86db6bc72649214ab2e4b51/pkg/securekit-disk/opt/securekit/sbin/disk-init#L82-L86

Quoted 3 lines

Here's one example of sealing and unsealing.
This method seems (probably?) to prevent the sniffing attack,

which

Quoted 4 lines

was a vulnerability of Bitlocker in the past.

But isn't a MITM attack possible in the process of creating an encrypted session?

So just to unpack the commands here for discussion I copied that code
block:

tpm2_createprimary -Q -C o -c tpm-primary.ctx tpm2_load -Q -C tpm-primary.ctx -u ${p1_dir}/seal.pub -r ${p1_dir}/seal.priv -c tpm-seal.ctx tpm2_startauthsession -Q --hmac-session -c tpm-primary.ctx -S session.ctx
tpm2_unseal -Q -p pcr:${tpm_seal_pcr_policy} -c tpm-seal.ctx -o ${output}
cleanupSession

The issue here is that the key created by the tpm2_createprimary command doesn't have provenance, so it's just be trusted implicitly even through it could be attacker controlled. If the attacker was controlling the primary object, they could just forward the commands
unencrypted to the TPM and get the unseal to release them the key in
the clear.

Quoted 3 lines

I am not familiar with the process of establishing a session, However, it seems that MITM can be prevented only by using a

session

Quoted 1 line

key encrypted with the EK of the TPM, or by signing the

asymmetric

Quoted 1 line

key with the EK to derive the key, when creating a session.

You just need a way to ensure provenance. Another way is to load an established key to the TPM and start the authsession with that. If you're using a persistent key you need to verify the name after establishing the session or use something like a serialized ESYS_TR which will do the name checking automatically. If you load a key blob
to the TPM that you control, ESAPI will have the checks in place to make sure you don't get duped.

Quoted 2 lines

Is MITM not considered in TPM? Or is there another way?

It is considered in the TPM and is discussed in the architecture document. Theirs a few ways you can securely set up an encrypted session, either with EK and associated Certificate or through other keys like the SRK. The big thing is, you have to do it in a way where
the attacker can not MiTM the session establishment, which boils down
to using a known key.

Quoted 11 lines

Regards,

_______________________________________________
tpm2 mailing list -- tpm2(a)lists.01.org<mailto:tpm2(a)lists.01.org>
To unsubscribe send an email to tpm2-leave(a)lists.01.org<mailto:tpm2-leave(a)lists.01.org> %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

[https://mail.zeronsoftn.com/mthumbnail/7b26b6d8-279b-4527-bfcd-9c3fb591e46c.png]

#9 lore raw
Quoted 2 lines · William C

The TPM2_Cerify command can certify that another key is the TPM based on a key you trust, like the EK.

But bear in mind that again your verifying to something so the threat is always the attacker changes to what your verifying to. If your verification data is as tamper-able as your store you didn't gain anything. If your verification data is on some RO partition that is checked for tampering, then that would be better.

Quoted 152 lines

Bill
From: joseph(a)zeronsoftn.com <joseph(a)zeronsoftn.com>
Sent: Friday, October 21, 2022 11:23 PM
To: Roberts, William C <william.c.roberts(a)intel.com>
Cc: tpm2(a)lists.01.org <tpm2(a)lists.01.org>
Subject: Re[5]: [tpm2] How can I prevent MITM attacks for unsealing?

Serialized primary.handle has a Public Key.
Is there a way to verify whether this public key is a key created by the TPM through the TPM's EK?
If this is possible, it will not be possible to protect against MITM in general, but if you have the CA of specific TPM manufacturers safely or remotely verify it, can be defend against MITM. 토요일, 22 10월 2022, 02:43오전 +09:00 발신 "Roberts, William C" william.c.roberts(a)intel.com:

Quoted 102 lines · joseph(a)zeronsoftn.com
Quoted 3 lines

Here is the commands I tried:

https://gist.github.com/jclab-joseph/d1d6d9bbbd32c0fe200cc7725bcf0d86

Quoted 6 lines

A session was established via a serialized persistent handle. This seems to be able to prevent MITM in the session connection process.

But, assume that an attacker can modify the filesystem. If the primary.handle can be replaced with the attacker's key,

the

Quoted 2 lines

session will be successfully established.
And I suspect that plaintext can be exposed if unsealed through

the

Quoted 4 lines

session.

Wouldn't validation be needed between the connected session and seal.ctx?

If the attacker can modify the primary.handle, which is verifying the
encrypted session, then yes you need something else. You could add a
bind key with a password and have the user enter the password and thus
nothing for the attacker to attack that is stored on disk.

Quoted 11 lines

화요일, 04 10월 2022, 00:54오전 +09:00 발신 "Roberts, William C" william.c.roberts(a)intel.com:

Quoted 7 lines · joseph(a)zeronsoftn.com
Quoted 5 lines

Hello,

Does anyone know about this issue?

https://github.com/jc-lab/securekit/blob/466abe16bfe4f28ef86db6bc72649214ab2e4b51/pkg/securekit-disk/opt/securekit/sbin/disk-init#L82-L86

Quoted 7 lines
Quoted 7 lines
Quoted 3 lines

Here's one example of sealing and unsealing.
This method seems (probably?) to prevent the sniffing attack,

which

Quoted 3 lines

was a vulnerability of Bitlocker in the past.

But isn't a MITM attack possible in the process of creating

an

Quoted 2 lines
Quoted 2 lines
Quoted 1 line

encrypted session?

So just to unpack the commands here for discussion I copied

that

Quoted 12 lines
Quoted 12 lines

code
block:

tpm2_createprimary -Q -C o -c tpm-primary.ctx tpm2_load -Q -C tpm-primary.ctx -u ${p1_dir}/seal.pub -r ${p1_dir}/seal.priv -c tpm-seal.ctx tpm2_startauthsession -Q --hmac-session -c tpm-primary.ctx -S session.ctx
tpm2_unseal -Q -p pcr:${tpm_seal_pcr_policy} -c tpm-seal.ctx -o ${output}
cleanupSession

Quoted 1 line
Quoted 1 line

The issue here is that the key created by the

tpm2_createprimary

Quoted 1 line
Quoted 1 line

command doesn't have provenance, so it's just be trusted

implicitly

Quoted 1 line
Quoted 1 line

even through it could be attacker controlled. If the attacker

was

Quoted 3 lines
Quoted 3 lines

controlling the primary object, they could just forward the commands
unencrypted to the TPM and get the unseal to release them the

key

Quoted 4 lines
Quoted 4 lines

in
the clear.

Quoted 1 line
Quoted 8 lines
Quoted 8 lines
Quoted 2 lines

I am not familiar with the process of establishing a session, However, it seems that MITM can be prevented only by using a

session

Quoted 1 line

key encrypted with the EK of the TPM, or by signing the

asymmetric

Quoted 1 line

key with the EK to derive the key, when creating a session.

You just need a way to ensure provenance. Another way is to

load an

Quoted 1 line
Quoted 1 line

established key to the TPM and start the authsession with that.

If

Quoted 2 lines
Quoted 2 lines

you're using a persistent key you need to verify the name after establishing the session or use something like a serialized

ESYS_TR

Quoted 1 line
Quoted 1 line

which will do the name checking automatically. If you load a

key

Quoted 2 lines
Quoted 2 lines

blob
to the TPM that you control, ESAPI will have the checks in

place to

Quoted 6 lines
Quoted 6 lines

make sure you don't get duped.

Quoted 2 lines

Is MITM not considered in TPM? Or is there another way?

It is considered in the TPM and is discussed in the

architecture

Quoted 25 lines
Quoted 1 line
Quoted 1 line

document. Theirs a few ways you can securely set up an

encrypted

Quoted 1 line
Quoted 1 line

session, either with EK and associated Certificate or through

other

Quoted 3 lines
Quoted 3 lines

keys like the SRK. The big thing is, you have to do it in a way where
the attacker can not MiTM the session establishment, which

boils

Quoted 17 lines
Quoted 14 lines

down
to using a known key.

Quoted 11 lines

Regards,

_______________________________________________
tpm2 mailing list -- tpm2(a)lists.01.org
To unsubscribe send an email to tpm2-leave(a)lists.01.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

_______________________________________________
tpm2 mailing list -- tpm2(a)lists.01.org
To unsubscribe send an email to tpm2-leave(a)lists.01.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s