Conversation
This was referenced Sep 20, 2026
kvinwang
force-pushed
the
fix/tpm-qvl-collateral-bounds
branch
from
September 23, 2026 07:06
df1b3ad to
6d697c0
Compare
kvinwang
force-pushed
the
fix/tpm-qvl-collateral-bounds
branch
4 times, most recently
from
September 23, 2026 08:37
6d19f59 to
91a4080
Compare
tpm-qvl and nsm-qvl fetch collateral before the quote is verified, from URLs in certificates the caller supplies: the TPM AK certificate's AIA and CRL distribution points, and every certificate in an NSM document's cabundle. Nothing bounded that work. tpm-qvl followed AIA links in an unconditional loop; both tried every CRL distribution point and read bodies without a size limit; nsm-qvl's async `reqwest::get` had no timeout at all, so one hanging distribution point stalled a Nitro verification forever. Move the duplicated CRL download code into a new `pki-fetch` crate whose `Fetcher` gives each collateral fetch one budget: 30s in total, 16 requests and 4 MiB of response bodies, with each request also capped at 10s so a hanging endpoint falls through to the next one. Bounding requests rather than chain depth or distribution points per certificate covers the AIA loop, long distribution point lists and an arbitrarily long cabundle alike. Real fetches use a fraction of it: GCP makes 3 requests (2 AIA hops, one 765-byte CRL), AWS Nitro 2. tpm-qvl moves from blocking to async reqwest: capping the body means streaming it, and the blocking client's `Read` restarts its timeout on every read. This also drops the `spawn_blocking` hop, and the nested runtime the mock-attestation test used to call the blocking fetch. No host allowlist: everything these endpoints serve still has to chain to the pinned platform root CA, so pinning hosts adds no attestation security. Restricting which networks the verifier may reach is an operator-side egress control.
kvinwang
force-pushed
the
fix/tpm-qvl-collateral-bounds
branch
from
September 23, 2026 09:51
91a4080 to
e8cbd99
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
tpm-qvl and nsm-qvl fetch collateral before the quote is verified, from URLs in certificates the caller supplies: the TPM AK certificate's AIA and CRL distribution points, and every certificate in an NSM document's
cabundle. Nothing bounded that work:reqwest::gethad no timeout at all: one hanging distribution point stalls a Nitro verification forever.The duplicated CRL download code moves into a new
pki-fetchcrate. ItsFetchergives each collateral fetch one budget: 30s total, 16 requests, 4 MiB of bodies, with each request also capped at 10s so a hanging endpoint falls through to the next. Bounding requests, rather than chain depth or distribution points per certificate, covers the AIA loop, long distribution-point lists and an arbitrarily longcabundlealike. Real fetches use a fraction of it: GCP makes 3 requests (2 AIA hops, one 765-byte CRL), AWS Nitro 2.tpm-qvl moves from blocking to async reqwest: capping the body means streaming it, and the blocking client's
Readrestarts its timeout on every read. This also drops thespawn_blockinghop and the nested runtime the mock-attestation test needed.No host allowlist: everything these endpoints serve still has to chain to the pinned platform root CA, so pinning hosts adds no attestation security. The verifier can still be made to GET attacker-chosen (including internal) addresses before the quote is verified; restricting which networks it may reach is an operator-side egress control.
Note:
TEST_FETCH_CRL=1in nsm-qvl fails onnexttoo — the fixture's regional CRL URL now returns 403.