Skip to content

fix(provider): enforce X.509-SVID leaf profile validation#433

Open
maxlambrecht wants to merge 1 commit into
spiffe:mainfrom
maxlambrecht:fix/trust-manager-x509-svid-profile
Open

fix(provider): enforce X.509-SVID leaf profile validation#433
maxlambrecht wants to merge 1 commit into
spiffe:mainfrom
maxlambrecht:fix/trust-manager-x509-svid-profile

Conversation

@maxlambrecht
Copy link
Copy Markdown
Member

What

Enforce X.509-SVID leaf profile validation when SpiffeTrustManager validates TLS peer certificate chains.

This extracts the existing X509Svid leaf checks into a package-private X509SvidProfile helper and reuses it from both X509Svid parsing and X509SvidValidator.verifyChain(...).

Why

SpiffeTrustManager previously extracted and authorized the SPIFFE ID and performed PKIX validation, but it did not reject peer leaf certificates that violated the X.509-SVID leaf profile.

This closes that gap by rejecting peer leaf certificates with CA=true, missing digitalSignature, keyCertSign, cRLSign, or more than one URI SAN, including one SPIFFE URI plus an additional non-SPIFFE URI.

How tested

Ran:

./gradlew :java-spiffe-core:test --tests io.spiffe.svid.x509svid.X509SvidTest --tests io.spiffe.svid.x509svid.X509SvidValidatorTest :java-spiffe-provider:test --tests io.spiffe.provider.SpiffeTrustManagerTest

@maxlambrecht maxlambrecht requested a review from rturner3 as a code owner May 9, 2026 20:15
@maxlambrecht maxlambrecht force-pushed the fix/trust-manager-x509-svid-profile branch from 38845d3 to 2ada65e Compare May 9, 2026 20:21
Signed-off-by: Max Lambrecht <maxlambrecht@gmail.com>
@maxlambrecht maxlambrecht force-pushed the fix/trust-manager-x509-svid-profile branch from 2ada65e to 5c5b85b Compare May 9, 2026 20:37
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