Skip to content

fix(core): harden SPIFFE URI SAN parsing#434

Open
maxlambrecht wants to merge 1 commit into
spiffe:mainfrom
maxlambrecht:fix/certificate-spiffe-uri-san-parsing
Open

fix(core): harden SPIFFE URI SAN parsing#434
maxlambrecht wants to merge 1 commit into
spiffe:mainfrom
maxlambrecht:fix/certificate-spiffe-uri-san-parsing

Conversation

@maxlambrecht
Copy link
Copy Markdown
Member

What

Harden CertificateUtils SPIFFE ID extraction by filtering Subject Alternative Name entries to URI SANs before casting SAN values, and wrap SPIFFE ID parse failures in CertificateException.

Why

Non-URI SAN values can use non-string value types, which could previously cause ClassCastException before the SAN type was checked. Malformed SPIFFE URI SANs could also let unchecked parsing exceptions escape trust validation paths.

How tested

  • Unit tests
  • Integration tests
  • Manual testing
  • Not applicable

Ran:

./gradlew :java-spiffe-core:test --tests io.spiffe.internal.CertificateUtilsTest

@maxlambrecht maxlambrecht requested a review from rturner3 as a code owner May 9, 2026 20:26
Signed-off-by: Max Lambrecht <maxlambrecht@gmail.com>
@maxlambrecht maxlambrecht force-pushed the fix/certificate-spiffe-uri-san-parsing branch from 9d9df62 to 59f1192 Compare May 9, 2026 20:43
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