Skip to content
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

TPM and Packed attestation not validating root certs #158

Closed
wants to merge 2 commits into from
Closed

TPM and Packed attestation not validating root certs #158

wants to merge 2 commits into from

Conversation

AdamUCF
Copy link
Contributor

@AdamUCF AdamUCF commented May 5, 2020

I was quite confused when my Solo Hacker key was passing attestation -- even with modified firmware. The root is not in the metadata repository (hacker has a different root than secure) and it didn't matter. It seems there was a misconception with what X509VerificationFlags.AllowUnknownCertificateAuthority actually does. dotnet/runtime#26449

This request adds a check to ensure that the root of the chain building matches the expected root from metadata.

@aseigler
Copy link
Collaborator

aseigler commented May 5, 2020

Good catch! Not terribly surprised since the conformance tests don't look for this specific situation and I don't have full negative unit tests written yet.

@AdamUCF AdamUCF closed this May 7, 2020
@AdamUCF AdamUCF reopened this May 7, 2020
@AdamUCF
Copy link
Contributor Author

AdamUCF commented May 7, 2020

From the "we never really intended to require attestation" in #158, I'm a bit perplexed looking in the code. It certainly seems like it is intended to validate and throw an error for any TPM, Packed or U2f (which I somehow missed and can fix) attestation that does not chain up to a trusted root from metadata or the known TPM certs. Perhaps if this is not the intention then it should be a flag passed in or a property passed back in a successful response? If this is merged, all untrusted attestations will result in an error.

@aseigler
Copy link
Collaborator

aseigler commented May 7, 2020

Yeah...that's why I haven't merged it yet. There are certain cases that are tested for (particularly related to conformance testing), but not completely strict because we don't have all of the roots because vendors are not required to publish roots, and we want people to be able to use their own homebrew stuff if they want.

I think the right thing to do here is put this behavior behind a flag and document it.

@aseigler
Copy link
Collaborator

aseigler commented May 8, 2020

I think it should work like this if chain fails to build. If we have known good metadata for given authenticator aaguid, or if TBD strict validation flag is set, fail the registration, otherwise let it go.

Does that sound reasonable?

@AdamUCF
Copy link
Contributor Author

AdamUCF commented May 8, 2020

That makes sense for Packed and U2F but not sure it does for TPM. How would you decide if you have "good metadata" for TPM?

@aseigler
Copy link
Collaborator

aseigler commented May 8, 2020

Good point. There is an official list of TPM identifiers from TCG, but I don't know if that covers every single TPM (or virtualized TPM) out there. I also don't know of a place with a published list of every single possible root for each TPM.

@AdamUCF AdamUCF closed this May 20, 2020
@AdamUCF
Copy link
Contributor Author

AdamUCF commented May 20, 2020

Closed this PR, working on adding the stuff we talked about here and #159 and will open a new PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants