Skip to content

Bug: set trust anchor with trusted certificates#789

Closed
zll600 wants to merge 1 commit intoweb-auth:5.3.xfrom
zll600:bugfix/set-trust-anchor-with-trusted-certificates
Closed

Bug: set trust anchor with trusted certificates#789
zll600 wants to merge 1 commit intoweb-auth:5.3.xfrom
zll600:bugfix/set-trust-anchor-with-trusted-certificates

Conversation

@zll600
Copy link
Copy Markdown
Contributor

@zll600 zll600 commented Dec 16, 2025

Target branch: 5.x
Resolves issue #788

  • It is a Bug fix
  • It is a New feature
  • Breaks BC
  • Includes Deprecations

Overview

Set the trust anchor with the trusted certificates when validating the certificate path.

Problems

The implementation passes the trusted certificate as the first certificate of the certificate path when validating.

$config = PathValidationConfig::create($this->clock->now(), self::MAX_VALIDATION_LENGTH);
CertificationPath::create(...$certificates)->validate($config);

This works well when the trusted certificate is self-signed because the self-signed certificate can be used to verify itself.

But it fails when the trusted certificate is an intermediate certificate(e.g., trust anchor from FIDO MDS).
The intermediate CA can not verify itself, which can only be verified with its issuer.

For any CA of FIDO MDS, we can trust it even if it is an intermediate CA, and use it as the trust anchor directly to verify the trust path of the attestation.

List of attestation trust anchors for the batch chain in the authenticator attestation. Each element of this array represents a PKIX [RFC5280] X.509 certificate that is a valid trust anchor for this authenticator model. Multiple certificates might be used for different batches of the same model. The array does not represent a certificate chain, but only the trust anchor of that chain. A trust anchor can be a root certificate, an intermediate CA certificate or even the attestation certificate itself.

@zll600 zll600 marked this pull request as ready for review December 16, 2025 01:33
@Spomky
Copy link
Copy Markdown
Contributor

Spomky commented Dec 20, 2025

I created another PR with those changes and based on 5.2.x.
Will be tagged 5.2.3.
Many thanks.

@Spomky Spomky closed this Dec 20, 2025
@zll600
Copy link
Copy Markdown
Contributor Author

zll600 commented Dec 20, 2025

Real thanks 🙇

Just for others' references, the new PR: #793

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.

2 participants