Skip to content

fix(attestation): reject malformed certificate data safely#204

Draft
Alicepoltora wants to merge 1 commit into
SeismicSystems:seismicfrom
Alicepoltora:agent/fix-attestation-cert-parsing
Draft

fix(attestation): reject malformed certificate data safely#204
Alicepoltora wants to merge 1 commit into
SeismicSystems:seismicfrom
Alicepoltora:agent/fix-attestation-cert-parsing

Conversation

@Alicepoltora

Copy link
Copy Markdown

Summary

The attestation endpoint already validates the outer DCAP quote, but the nested QE/PCK certificate data was still parsed with unchecked unwrap, expect, assert, and direct indexing. A malformed quote could therefore panic the enclave while extracting the FMSPC and issuer before PCCS verification.

This change:

  • makes PCK/FMSPC extraction fallible and propagates errors through PCCS collateral lookup;
  • validates the minimum nested QE report length, certificate-chain presence, SGX extension encoding, FMSPC length, and trailing bytes;
  • keeps a panic boundary around the current infallible dcap-rs nested parser as defense in depth;
  • adds regression tests for truncated QE data and malicious nested length fields.

Impact

Malformed attestation evidence now returns a JSON-RPC error instead of terminating the enclave server. Valid certificate extraction and PCCS verification behavior is unchanged.

Verification

  • cargo fmt --all --check
  • cargo test -p seismic-enclave-server --lib (10 passed)

The full package test command compiles successfully; its privileged bootstrap integration test is skipped/fails in this environment because it requires sudo.

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.

1 participant