Skip to content

fix: return verification failure when Apple root CA is nil in MDA cert chain#126

Open
antojoseph wants to merge 1 commit into
masterfrom
security/f013-mda-nil-root-verifier
Open

fix: return verification failure when Apple root CA is nil in MDA cert chain#126
antojoseph wants to merge 1 commit into
masterfrom
security/f013-mda-nil-root-verifier

Conversation

@antojoseph
Copy link
Copy Markdown

Summary

  • mda.go: when appleRootCA == nil (the pool contains no root cert), return Valid=false with a descriptive error instead of silently falling through to Valid=true
  • mda_test.go: updated TestVerifyMDACertChainNilRoot to assert Valid=false

Security impact

Before this fix an attestation request with a crafted cert chain could pass MDA verification when the Apple root CA pool was empty (e.g., cert file missing or misconfigured), granting mda_verified trust to an unattesteddevice. The fix ensures an empty root pool is a hard failure.

Test plan

  • go test ./internal/attestation/...
  • Verify TestVerifyMDACertChainNilRoot now passes (was asserting wrong direction)

VerifyMDACertChain previously set result.Valid=true even when appleRootCA
was nil, meaning a self-signed cert passed through unverified. Any caller
that passed nil got a 'valid' result with no chain verification at all.

Now: a nil root CA returns Valid=false with an explanatory error. DeviceSerial
is still populated so callers can log the device identity. The test that
previously locked in the insecure behavior is updated to match.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 4, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
d-inference Ready Ready Preview May 4, 2026 2:49am
d-inference-console-ui-dev Ready Ready Preview May 4, 2026 2:49am
d-inference-landing Ready Ready Preview May 4, 2026 2:49am

Request Review

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