[OID4VCI] Harden key attestation x5c certificate validation#51042
[OID4VCI] Harden key attestation x5c certificate validation#51042forkimenjeckayang wants to merge 4 commits into
Conversation
Signed-off-by: forkimenjeckayang <forkimenjeckayang@gmail.com>
There was a problem hiding this comment.
Pull request overview
Hardens OID4VCI key-attestation certificate validation by introducing dedicated X.509 trust material and policies.
Changes:
- Adds isolated PKIX validation with EKU, end-entity, and revocation enforcement.
- Adds trust-provider and Admin Console X.509 configuration.
- Expands documentation and integration/UI tests.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
tests/base/.../OID4VCKeyAttestationTest.java |
Tests attestation certificate policies. |
services/.../X5cKeyUtils.java |
Decodes chains and converts leaf keys. |
services/.../TrustedAttestationKeyResolver.java |
Resolves configured X.509 trust. |
services/.../StaticAttestationKeyResolver.java |
Supports static X.509 trust material. |
services/.../JwtProofValidator.java |
Preserves proof-key x5c conveyance. |
services/.../AttestationX509CertificateValidator.java |
Implements PKIX policy validation. |
services/.../AttestationValidatorUtil.java |
Removes system-truststore attestation validation. |
services/.../AttestationKeyResolver.java |
Adds certificate-chain resolution API. |
services/.../DefaultTrustIdentityProviderConfig.java |
Defines and validates X.509 settings. |
services/.../DefaultTrustIdentityProvider.java |
Exposes X.509 trust material. |
services/.../TrustMaterialResolver.java |
Resolves X.509 material by provider. |
server-spi-private/.../X509TrustMaterial.java |
Models trust anchors and policy. |
server-spi-private/.../TrustMaterialIdentityProvider.java |
Extends the trust-provider SPI. |
js/.../default-trust.spec.ts |
Tests new Admin Console controls. |
js/.../DefaultTrustSettings.tsx |
Adds X.509 configuration fields. |
js/.../messages_en.properties |
Adds X.509 setting labels and help. |
docs/.../proofs.adoc |
Documents attestation trust configuration. |
Unreported flaky test detectedIf the flaky tests below are affected by the changes, please review and update the changes accordingly. Otherwise, a maintainer should report the flaky tests prior to merging the PR. org.keycloak.testsuite.forms.BrowserFlowTest#testUserWithOneAdditionalFactorOtpSuccessorg.keycloak.testsuite.forms.MultipleTabsLoginTest#multipleTabsParallelLoginTestWithAuthSessionExpiredAndRequiredActionKeycloak CI - Forms IT (chrome) org.keycloak.testsuite.oauth.ClientAuthPostMethodTest#testPostAuthenticationNotAllowedWhenBasicRequestedorg.keycloak.testsuite.oauth.ClientAuthPostMethodTest#testBasicAuthenticationNotAllowedWhenPostRequestedorg.keycloak.testsuite.forms.MultipleTabsLoginTest#testEmptyBaseUrlKeycloak CI - Forms IT (firefox) org.keycloak.testsuite.forms.MultipleTabsLoginTest#multipleTabsParallelLoginTestKeycloak CI - Forms IT (firefox) |
Signed-off-by: forkimenjeckayang <forkimenjeckayang@gmail.com>
Signed-off-by: forkimenjeckayang <forkimenjeckayang@gmail.com>
Signed-off-by: forkimenjeckayang <forkimenjeckayang@gmail.com>
Unreported flaky test detectedIf the flaky tests below are affected by the changes, please review and update the changes accordingly. Otherwise, a maintainer should report the flaky tests prior to merging the PR. org.keycloak.testsuite.forms.BrowserFlowTest#testUserWithOneAdditionalFactorOtpSuccessorg.keycloak.testsuite.forms.MultipleTabsLoginTest#multipleTabsParallelLoginTestWithAuthSessionExpiredInTheMiddleKeycloak CI - Forms IT (chrome) org.keycloak.testsuite.forms.MultipleTabsLoginTest#multipleTabsParallelLoginTestWithAuthSessionExpiredAndRefreshInTab1Keycloak CI - Forms IT (chrome) |
Summary
This change hardens validation of X.509 certificate chains supplied through the
x5cheader of OID4VCI key attestations.Previously, attestation chains were validated against the JVM system truststore,
which allowed certificates issued by general Web PKI certificate authorities.
Revocation checking was disabled and no Extended Key Usage policy was enforced.
The implementation now:
by the trust-material identity providers configured for the OID4VCI client;
certificate-signing usage;
information is unavailable;
x5cas a key-conveyance mechanism for ordinary JWT proofs, whereattestation trust validation does not apply;
trust.
closes #50518