Skip to content

Conversation

@frankdavid
Copy link
Contributor

@frankdavid frankdavid commented Jan 5, 2026

This PR adds namespacing to the SEV custom data to prevent attestation reports from being reused across different contexts. Previously it was possible to generate an attestation report for one use case and then use it in another.

For example, during a GuestOS upgrade, the Guest VM running the new GuestOS version has to prove that it's running a blessed GuestOS version in order to get the disk encryption key, which it does by generating an attestation report with a specific custom data field in the attestation report. Without namespacing, the upgrade VM can use the remote attestation endpoint of the old Guest VM to generate an attestation report with this specific custom data (this is possible since an attestation report with arbitrary custom data can be requested). This way, the upgrade VM can run arbitrary software since it can take the attestation report from a valid Guest VM. Similar attacks can be constructed in other scenarios whenever an attestation report leaves the Guest VM.

Namespaced custom data ensures that use cases are separated. An attestation report generated for remote attestation cannot be used during upgrades since the namespaces are different.

Custom data now consists of:

| namespace (4 bytes) |           unused (28 bytes)           |                     data (32 bytes)                     |

Namespaces are arbitrary 4 bytes which for convenience we represent as SevCustomDataNamespace.

The remote attestation endpoint now only takes 32-byte inputs and prefixes the custom data in the attestion report with [1, 0, 0, 0].

Types that can be used as custom data via DER-encoding (currently only GetDiskEncryptionKeyTokenCustomData) were previously encoded by
SHA512(DER(object)). These are now encoded using namespace || [0; 28] || SHA256(DER(object))

For backwards compatibility, GetDiskEncryptionKeyTokenCustomData will still be encoded with the legacy encoding so that we can upgrade once. The attestation report verifier code accepts both encodings for GetDiskEncryptionKeyTokenCustomData. New types are encoded with the new encoding.

There will be two more steps of this migration:

  1. Once all GuestOS-s accept the new encoding (i.e. they contain this PR), the generation code will be moved to the new encoding for all types.
  2. Once all GuestOS-s generate the new encoding (i.e. they contain (1)), the verification code will only accept the new encoding.

The PR also adds tests to the previously poorly tested remote attestation service.

@frankdavid frankdavid requested a review from a team as a code owner January 5, 2026 14:51
@frankdavid frankdavid force-pushed the frankdavid/namespaced-custom-data branch from 3841e77 to 5345070 Compare January 5, 2026 18:38
…ed-custom-data

# Conflicts:
#	rs/ic_os/attestation/src/e2e_tests.rs
#	rs/ic_os/remote_attestation/server/src/main.rs
@frankdavid frankdavid requested a review from Bownairo January 12, 2026 14:52
@frankdavid frankdavid enabled auto-merge January 15, 2026 17:36
@frankdavid frankdavid disabled auto-merge January 15, 2026 17:46
@frankdavid frankdavid added this pull request to the merge queue Jan 15, 2026
Merged via the queue into master with commit 789e5a1 Jan 15, 2026
37 checks passed
@frankdavid frankdavid deleted the frankdavid/namespaced-custom-data branch January 15, 2026 23:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants