René's URL Explorer Experiment


Title: Infinite recursion in CertPathBuilder with multiple root CA certificates · Issue #2291 · bcgit/bc-java · GitHub

Open Graph Title: Infinite recursion in CertPathBuilder with multiple root CA certificates · Issue #2291 · bcgit/bc-java

X Title: Infinite recursion in CertPathBuilder with multiple root CA certificates · Issue #2291 · bcgit/bc-java

Description: While testing the JCA CertPathBuilder provider with my internal company CA topology, I have encountered an infinite recursion leading to a stack overflow. I have created a minimal reproducible test case in the following gist. The same ex...

Open Graph Description: While testing the JCA CertPathBuilder provider with my internal company CA topology, I have encountered an infinite recursion leading to a stack overflow. I have created a minimal reproducible test...

X Description: While testing the JCA CertPathBuilder provider with my internal company CA topology, I have encountered an infinite recursion leading to a stack overflow. I have created a minimal reproducible test...

Opengraph URL: https://github.com/bcgit/bc-java/issues/2291

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Infinite recursion in CertPathBuilder with multiple root CA certificates","articleBody":"While testing the JCA `CertPathBuilder` provider with my internal company CA topology, I have encountered an infinite recursion leading to a stack overflow. I have created a minimal reproducible test case in the following [gist](https://gist.github.com/charlesvdv/8b63e3897ff47c2afd7d3d29f8d1251d). The same example work fine when switching to the `SUN` provider. \n\nFrom my investigation, in order to reproduce the infinite recursion, the following must be true: \n\n- CRL must be used for revocation\n- There must be more than one valid root CA certificate\n\nHere is the stack overflow: \n```\n\tat java.base/java.io.FilterInputStream.read(FilterInputStream.java:71)\n\tat org.bouncycastle.asn1.DefiniteLengthInputStream.read(Unknown Source)\n\tat java.base/java.io.FilterInputStream.read(FilterInputStream.java:71)\n\tat org.bouncycastle.asn1.DefiniteLengthInputStream.read(Unknown Source)\n\tat java.base/java.io.FilterInputStream.read(FilterInputStream.java:71)\n\tat org.bouncycastle.asn1.ASN1InputStream.readObject(Unknown Source)\n\tat org.bouncycastle.asn1.ASN1InputStream.readVector(Unknown Source)\n\tat org.bouncycastle.asn1.ASN1InputStream.readVector(Unknown Source)\n\tat org.bouncycastle.asn1.ASN1InputStream.buildObject(Unknown Source)\n\tat org.bouncycastle.asn1.ASN1InputStream.readObject(Unknown Source)\n\tat org.bouncycastle.asn1.ASN1InputStream.readVector(Unknown Source)\n\tat org.bouncycastle.asn1.ASN1InputStream.readVector(Unknown Source)\n\tat org.bouncycastle.asn1.ASN1InputStream.buildObject(Unknown Source)\n\tat org.bouncycastle.asn1.ASN1InputStream.readObject(Unknown Source)\n\tat org.bouncycastle.asn1.ASN1InputStream.readVector(Unknown Source)\n\tat org.bouncycastle.asn1.ASN1InputStream.readVector(Unknown Source)\n\tat org.bouncycastle.asn1.ASN1InputStream.buildObject(Unknown Source)\n\tat org.bouncycastle.asn1.ASN1InputStream.readObject(Unknown Source)\n\tat org.bouncycastle.asn1.ASN1Primitive.fromByteArray(Unknown Source)\n\tat org.bouncycastle.asn1.ASN1UniversalType.fromByteArray(Unknown Source)\n\tat org.bouncycastle.asn1.ASN1Sequence.getInstance(Unknown Source)\n\tat org.bouncycastle.asn1.x500.X500Name.getInstance(Unknown Source)\n\tat org.bouncycastle.jce.provider.PrincipalUtils.getX500Name(Unknown Source)\n\tat org.bouncycastle.jce.provider.PrincipalUtils.getIssuerPrincipal(Unknown Source)\n\tat org.bouncycastle.jce.provider.CertPathValidatorUtilities.findIssuerCerts(Unknown Source)\n\tat org.bouncycastle.jce.provider.PKIXCertPathBuilderSpi_8.build(Unknown Source)\n\tat org.bouncycastle.jce.provider.PKIXCertPathBuilderSpi_8.engineBuild(Unknown Source)\n\tat org.bouncycastle.jce.provider.RFC3280CertPathUtilities.processCRLF(Unknown Source)\n\tat org.bouncycastle.jce.provider.RFC3280CertPathUtilities.checkCRL(Unknown Source)\n\tat org.bouncycastle.jce.provider.RFC3280CertPathUtilities.checkCRLs(Unknown Source)\n\tat org.bouncycastle.jce.provider.ProvCrlRevocationChecker.check(Unknown Source)\n\tat org.bouncycastle.jce.provider.ProvRevocationChecker.check(Unknown Source)\n\tat java.base/java.security.cert.PKIXCertPathChecker.check(PKIXCertPathChecker.java:176)\n\tat org.bouncycastle.jce.provider.RFC3280CertPathUtilities.processCertA(Unknown Source)\n\tat org.bouncycastle.jce.provider.PKIXCertPathValidatorSpi_8.engineValidate(Unknown Source)\n\tat org.bouncycastle.jce.provider.PKIXCertPathBuilderSpi_8.build(Unknown Source)\n\tat org.bouncycastle.jce.provider.PKIXCertPathBuilderSpi_8.build(Unknown Source)\n\tat org.bouncycastle.jce.provider.PKIXCertPathBuilderSpi_8.engineBuild(Unknown Source)\n\tat org.bouncycastle.jce.provider.RFC3280CertPathUtilities.processCRLF(Unknown Source)\n\tat org.bouncycastle.jce.provider.RFC3280CertPathUtilities.checkCRL(Unknown Source)\n\tat org.bouncycastle.jce.provider.RFC3280CertPathUtilities.checkCRLs(Unknown Source)\n\tat org.bouncycastle.jce.provider.ProvCrlRevocationChecker.check(Unknown Source)\n\tat org.bouncycastle.jce.provider.ProvRevocationChecker.check(Unknown Source)\n\tat java.base/java.security.cert.PKIXCertPathChecker.check(PKIXCertPathChecker.java:176)\n\tat org.bouncycastle.jce.provider.RFC3280CertPathUtilities.processCertA(Unknown Source)\n\tat org.bouncycastle.jce.provider.PKIXCertPathValidatorSpi_8.engineValidate(Unknown Source)\n\tat org.bouncycastle.jce.provider.PKIXCertPathBuilderSpi_8.build(Unknown Source)\n\tat org.bouncycastle.jce.provider.PKIXCertPathBuilderSpi_8.build(Unknown Source)\n\tat org.bouncycastle.jce.provider.PKIXCertPathBuilderSpi_8.engineBuild(Unknown Source)\n\tat org.bouncycastle.jce.provider.RFC3280CertPathUtilities.processCRLF(Unknown Source)\n\tat org.bouncycastle.jce.provider.RFC3280CertPathUtilities.checkCRL(Unknown Source)\n\tat org.bouncycastle.jce.provider.RFC3280CertPathUtilities.checkCRLs(Unknown Source)\n\tat org.bouncycastle.jce.provider.ProvCrlRevocationChecker.check(Unknown Source)\n\tat org.bouncycastle.jce.provider.ProvRevocationChecker.check(Unknown Source)\n\tat java.base/java.security.cert.PKIXCertPathChecker.check(PKIXCertPathChecker.java:176)\n\tat org.bouncycastle.jce.provider.RFC3280CertPathUtilities.processCertA(Unknown Source)\n\tat org.bouncycastle.jce.provider.PKIXCertPathValidatorSpi_8.engineValidate(Unknown Source)\n\tat org.bouncycastle.jce.provider.PKIXCertPathBuilderSpi_8.build(Unknown Source)\n\tat org.bouncycastle.jce.provider.PKIXCertPathBuilderSpi_8.build(Unknown Source)\n\tat org.bouncycastle.jce.provider.PKIXCertPathBuilderSpi_8.engineBuild(Unknown Source)\n\tat org.bouncycastle.jce.provider.RFC3280CertPathUtilities.processCRLF(Unknown Source)\n\tat org.bouncycastle.jce.provider.RFC3280CertPathUtilities.checkCRL(Unknown Source)\n\tat org.bouncycastle.jce.provider.RFC3280CertPathUtilities.checkCRLs(Unknown Source)\n\tat org.bouncycastle.jce.provider.ProvCrlRevocationChecker.check(Unknown Source)\n\tat org.bouncycastle.jce.provider.ProvRevocationChecker.check(Unknown Source)\n\tat java.base/java.security.cert.PKIXCertPathChecker.check(PKIXCertPathChecker.java:176)\n\tat org.bouncycastle.jce.provider.RFC3280CertPathUtilities.processCertA(Unknown Source)\n\tat org.bouncycastle.jce.provider.PKIXCertPathValidatorSpi_8.engineValidate(Unknown Source)\n\tat org.bouncycastle.jce.provider.PKIXCertPathBuilderSpi_8.build(Unknown Source)\n\tat org.bouncycastle.jce.provider.PKIXCertPathBuilderSpi_8.build(Unknown Source)\n\tat org.bouncycastle.jce.provider.PKIXCertPathBuilderSpi_8.engineBuild(Unknown Source)\n\tat org.bouncycastle.jce.provider.RFC3280CertPathUtilities.processCRLF(Unknown Source)\n\tat org.bouncycastle.jce.provider.RFC3280CertPathUtilities.checkCRL(Unknown Source)\n\tat org.bouncycastle.jce.provider.RFC3280CertPathUtilities.checkCRLs(Unknown Source)\n\tat org.bouncycastle.jce.provider.ProvCrlRevocationChecker.check(Unknown Source)\n\tat org.bouncycastle.jce.provider.ProvRevocationChecker.check(Unknown Source)\n\tat java.base/java.security.cert.PKIXCertPathChecker.check(PKIXCertPathChecker.java:176)\n...\n```\n\nThe root cause seems to come from [here](https://github.com/bcgit/bc-java/blob/a46adf354451eb2b1abf80314cbff87ac2c4d466/pkix/src/main/java/org/bouncycastle/pkix/jcajce/RFC3280CertPathUtilities.java#L484). The validation for the CRL re-trigger a validation of the root CA certificate which includes a validation of the CRL, etc. \n\nIn RFC5280 (which obsolete RFC3280), the following security consideration has been added (emphasis mine) which seems similar to the issue described above: \n> When certificates include a cRLDistributionPoints extension with an\n  https URI or similar scheme, circular dependencies can be introduced.\n  **The relying party is forced to perform an additional path validation\n  in order to obtain the CRL required to complete the initial path\n  validation!**  Circular conditions can also be created with an https\n  URI (or similar scheme) in the authorityInfoAccess or\n  subjectInfoAccess extensions.  At worst, this situation can create\n  unresolvable dependencies.\n\nThank you for your support.","author":{"url":"https://github.com/charlesvdv","@type":"Person","name":"charlesvdv"},"datePublished":"2026-05-03T15:07:48Z","url":"https://github.com/bcgit/bc-java/issues/2291"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:3bf72e21-d67f-4d35-21f7-4ffb602cbdb9
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id93B0:1FB7E7:4FB0D9:6B0767:6AFBEFE3
html-safe-nonceca7dbc557891e57935edf8f1f77ba7408ff320ebcee638571b633bf04d033e76
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5M0IwOjFGQjdFNzo0RkIwRDk6NkIwNzY3OjZBRkJFRkUzIiwidmlzaXRvcl9pZCI6IjgyMzczODE1Mjg5OTI4NzAzNzEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac8da41f8dd912aaa8bb44f68f08ebd6a12dffc9918c5eb4fa76969f9647ba135b
hovercard-subject-tagissue:4372144387
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/bcgit/bc-java/2291/issue_layout
twitter:imagehttps://opengraph.githubassets.com/a63c8758d7ad90fff8dc63da5633f5c4dbe5031b9288dfb2c98bab51088a51dd/bcgit/bc-java/issues/2291
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/a63c8758d7ad90fff8dc63da5633f5c4dbe5031b9288dfb2c98bab51088a51dd/bcgit/bc-java/issues/2291
og:image:altWhile testing the JCA CertPathBuilder provider with my internal company CA topology, I have encountered an infinite recursion leading to a stack overflow. I have created a minimal reproducible test...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamecharlesvdv
hostnamegithub.com
expected-hostnamegithub.com
Nonefa74413a1d84dac536fcca0740780bcbd3207bafec0e51873b73ff8e8cca032f
turbo-cache-controlno-preview
go-importgithub.com/bcgit/bc-java git https://github.com/bcgit/bc-java.git
octolytics-dimension-user_id4566970
octolytics-dimension-user_loginbcgit
octolytics-dimension-repository_id10416648
octolytics-dimension-repository_nwobcgit/bc-java
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id10416648
octolytics-dimension-repository_network_root_nwobcgit/bc-java
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releaseb3b5633a74535d9c23385512d534c66c8fde1907
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/bcgit/bc-java/issues/2291#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fbcgit%2Fbc-java%2Fissues%2F2291
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fbcgit%2Fbc-java%2Fissues%2F2291
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=bcgit%2Fbc-java
Reloadhttps://github.com/bcgit/bc-java/issues/2291
Reloadhttps://github.com/bcgit/bc-java/issues/2291
Reloadhttps://github.com/bcgit/bc-java/issues/2291
bcgithttps://github.com/bcgit
bc-javahttps://github.com/bcgit/bc-java
Codehttps://github.com/bcgit/bc-java
Issues47 (47)https://github.com/bcgit/bc-java/issues
Pull requests18 (18)https://github.com/bcgit/bc-java/pulls
Discussionshttps://github.com/bcgit/bc-java/discussions
Actionshttps://github.com/bcgit/bc-java/actions
Projectshttps://github.com/bcgit/bc-java/projects
Wikihttps://github.com/bcgit/bc-java/wiki
Security and qualityhttps://github.com/bcgit/bc-java/security
Insightshttps://github.com/bcgit/bc-java/pulse
https://github.com/bcgit/bc-java
New issuehttps://github.com/login?return_to=https://github.com/bcgit/bc-java/issues/2291
New issuehttps://github.com/login?return_to=https://github.com/bcgit/bc-java/issues/2291
Infinite recursion in CertPathBuilder with multiple root CA certificateshttps://github.com/bcgit/bc-java/issues/2291#top
https://github.com/dghgit
bugSomething isn't workinghttps://github.com/bcgit/bc-java/issues?q=state%3Aopen%20label%3A%22bug%22
https://github.com/charlesvdv
charlesvdvhttps://github.com/charlesvdv
on May 3, 2026https://github.com/bcgit/bc-java/issues/2291#issue-4372144387
gisthttps://gist.github.com/charlesvdv/8b63e3897ff47c2afd7d3d29f8d1251d
herehttps://github.com/bcgit/bc-java/blob/a46adf354451eb2b1abf80314cbff87ac2c4d466/pkix/src/main/java/org/bouncycastle/pkix/jcajce/RFC3280CertPathUtilities.java#L484
https://github.com/dghgit
dghgithttps://github.com/dghgit
on May 4, 2026https://github.com/bcgit/bc-java/issues/2291#issuecomment-4368634542
https://www.bouncycastle.org/betashttps://www.bouncycastle.org/betas
hubothttps://github.com/hubot
on May 4, 2026https://github.com/bcgit/bc-java/issues/2291#event-25125745145
removed possible recursion on misconfigured CertPath validations, rel…https://github.com/bcgit/bc-java/commit/790ac4b5a37298f36d11063dfb6fc1efa3a62cc3
790ac4bhttps://github.com/bcgit/bc-java/commit/790ac4b5a37298f36d11063dfb6fc1efa3a62cc3
tweak on misconfigured CertPath validations, relates to github #2291https://github.com/bcgit/bc-java/commit/71ede26bf5102831ee8e5c8ff3e560419296806d
#2291https://github.com/bcgit/bc-java/issues/2291
71ede26https://github.com/bcgit/bc-java/commit/71ede26bf5102831ee8e5c8ff3e560419296806d
dghgithttps://github.com/dghgit
on May 5, 2026https://github.com/bcgit/bc-java/issues/2291#event-25156849341
https://github.com/charlesvdv
charlesvdvhttps://github.com/charlesvdv
on May 7, 2026https://github.com/bcgit/bc-java/issues/2291#issuecomment-4399704466
@dghgithttps://github.com/dghgit
gisthttps://gist.github.com/charlesvdv/8b63e3897ff47c2afd7d3d29f8d1251d
https://github.com/dghgit
dghgithttps://github.com/dghgit
on May 8, 2026https://github.com/bcgit/bc-java/issues/2291#issuecomment-4402254483
https://www.bouncycastle.org/betashttps://www.bouncycastle.org/betas
hubothttps://github.com/hubot
on May 10, 2026https://github.com/bcgit/bc-java/issues/2291#event-25348831464
further work on CRL performance - relates to github #2291https://github.com/bcgit/bc-java/commit/e09229989197b361f8c1a1743977f0f687860166
#2291https://github.com/bcgit/bc-java/issues/2291
e092299https://github.com/bcgit/bc-java/commit/e09229989197b361f8c1a1743977f0f687860166
charlesvdvhttps://github.com/charlesvdv
completedhttps://github.com/bcgit/bc-java/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on May 22, 2026https://github.com/bcgit/bc-java/issues/2291#event-25866845046
https://github.com/charlesvdv
charlesvdvhttps://github.com/charlesvdv
on May 22, 2026https://github.com/bcgit/bc-java/issues/2291#issuecomment-4522227530
winfriedgerlachhttps://github.com/winfriedgerlach
bugSomething isn't workinghttps://github.com/bcgit/bc-java/issues?q=state%3Aopen%20label%3A%22bug%22
on Jul 15, 2026https://github.com/bcgit/bc-java/issues/2291#event-28005291081
Sign up for freehttps://github.com/signup?return_to=https://github.com/bcgit/bc-java/issues/2291
Sign in to commenthttps://github.com/login?return_to=https://github.com/bcgit/bc-java/issues/2291
dghgithttps://github.com/dghgit
bugSomething isn't workinghttps://github.com/bcgit/bc-java/issues?q=state%3Aopen%20label%3A%22bug%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.