flashbots / flashbots/attested-tls

Attestation evidence is size restricted because rustls caps Certificate handshake message at 64kb

Open
#75 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
5
Forks
3
Avg merge
4d 1h
Merged PRs (30d)
8

Description

The `attested-tls` crate puts attestation evidence (TDX quote or Azure vTMP attestation) into the TLS certificate via a x509 extension, which is verified during TLS handshake.

This evidence together with the certificate(s) must not exceed 64 kb due to a restriction imposed by Rustls.

https://docs.rs/rustls/0.23.37/rustls/enum.InvalidMessage.html#variant.CertificatePayloadTooLarge

When using a private CA, rather than self-signed, we also need to budget for the CA root cert in the certificate chain. So if guessing a certificate is around 1kb (usually its less), we have around 62kb for the payload. To be really safe we could avoid going over 60kb.

This is not an issue with are current evidence payloads, but important to bear in mind when adding additional data to the payload.

For example:
- We propose to add collateral to the payload in https://github.com/flashbots/attested-tls/pull/65
- We recently added 'platform metadata'. This is currently very small (less than 1 kb), but could be extended with future versions of `attest`.
- Future versions of TDX are expected to significantly increase the evidence payload size. This is the biggest concern, but may not happen for a while, and the exact details are not yet known.
- At some point we may add Platform Ownership Edorsements (POEs). Its debatable whether this would be part of the evidence payload, but worth bearing in mind.

Note that this issue is with Rustls, not with the TLS spec. I think the TLS spec is considerably more generous (16mb limit). The reason for adding this is to restrict memory allocation caused by unauthenticated remote inputs, as described here: https://github.com/rustls/rustls/commit/dfa926abf2728fa3b3ca0a8c33bbc61013fef9cc It is possible that it will change with future versions of Rustls.

For comparison, Go's `crypto/tls` caps `Certificate` at 256kb, and OpenSSL caps it at 100kb (but configurable).

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the attested-tls crate's certificate and attestation path, then read rustls 0.23.37's CertificatePayloadTooLarge documentation and the collateral discussion in PR #65. Define how certificate-chain and evidence sizes should be tracked or documented; the issue is resolved when the supported payload budget is explicit for future evidence additions.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
security
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.