Skip to content

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

Merged
maxlambrecht merged 1 commit into
spiffe:mainfrom
maxlambrecht:fix/certificate-spiffe-uri-san-parsing
Jul 23, 2026
Merged

fix(core): harden SPIFFE URI SAN parsing#434
maxlambrecht merged 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
@maxlambrecht
maxlambrecht force-pushed the fix/certificate-spiffe-uri-san-parsing branch from 9d9df62 to 59f1192 Compare May 9, 2026 20:43
@maxlambrecht
maxlambrecht force-pushed the fix/certificate-spiffe-uri-san-parsing branch from 59f1192 to c6b661e Compare July 18, 2026 20:37
Signed-off-by: Max Lambrecht <maxlambrecht@gmail.com>
@maxlambrecht
maxlambrecht force-pushed the fix/certificate-spiffe-uri-san-parsing branch from 4647d4b to 6a11b57 Compare July 23, 2026 15:33
@maxlambrecht
maxlambrecht merged commit af13baa into spiffe:main Jul 23, 2026
8 checks passed
@maxlambrecht
maxlambrecht deleted the fix/certificate-spiffe-uri-san-parsing branch July 23, 2026 15:34
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