René's URL Explorer Experiment


Title: Possible incompliance with RFC 8017 on RSA PKCS-v1.5 validation · Issue #2273 · bcgit/bc-java · GitHub

Open Graph Title: Possible incompliance with RFC 8017 on RSA PKCS-v1.5 validation · Issue #2273 · bcgit/bc-java

X Title: Possible incompliance with RFC 8017 on RSA PKCS-v1.5 validation · Issue #2273 · bcgit/bc-java

Description: Hello, It looks like BouncyCastle does not implement a strict validation of RSA signatures according to the requirements stated in RFC 8017. In particular, the issue concerns the DigestSignatureSpi class, that implements a fallback mecha...

Open Graph Description: Hello, It looks like BouncyCastle does not implement a strict validation of RSA signatures according to the requirements stated in RFC 8017. In particular, the issue concerns the DigestSignatureSpi...

X Description: Hello, It looks like BouncyCastle does not implement a strict validation of RSA signatures according to the requirements stated in RFC 8017. In particular, the issue concerns the DigestSignatureSpi...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Possible incompliance with RFC 8017 on RSA PKCS-v1.5 validation","articleBody":"Hello,\n\nIt looks like BouncyCastle does not implement a strict validation of RSA signatures according to the requirements stated in [RFC 8017](https://www.rfc-editor.org/rfc/rfc8017).\n\nIn particular, the issue concerns the [DigestSignatureSpi](https://github.com/bcgit/bc-java/blob/r1rv83/prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/rsa/DigestSignatureSpi.java) class, that implements a fallback mechanism for, in fact, incorrectly encoded signatures, such as the ones omitting  within the signed DigestInfo the NULL parameter field of the AlgorithmIdentifier attribute.\n\nPlease see the RFC 8017:\n\n>[A.2.2](https://www.rfc-editor.org/rfc/rfc8017#appendix-A.2.2).  RSAES-PKCS-v1_5\n>\n>  The object identifier rsaEncryption (see [Appendix A.1](https://www.rfc-editor.org/rfc/rfc8017#appendix-A.1)) identifies the\n>   RSAES-PKCS1-v1_5 encryption scheme.  The parameters field associated\n>   with this OID in a value of type AlgorithmIdentifier SHALL have a\n>   value of type NULL.  This is the same as in PKCS #1 v1.5.\n\nIt also lists the definitions for every digest algorithm scheme:\n\n> digestAlgorithm identifies the hash function and SHALL be an\n>   algorithm ID with an OID in the set PKCS1-v1-5DigestAlgorithms.  For\n>   a discussion of supported hash functions, see [Appendix B.1](https://www.rfc-editor.org/rfc/rfc8017#appendix-B.1).\n>\n>       DigestAlgorithm ::= AlgorithmIdentifier {\n>          {PKCS1-v1-5DigestAlgorithms}\n>       }\n>\n>       PKCS1-v1-5DigestAlgorithms    ALGORITHM-IDENTIFIER ::= {\n>           { OID id-md2        PARAMETERS NULL }|\n>           { OID id-md5        PARAMETERS NULL }|\n>           { OID id-sha1       PARAMETERS NULL }|\n>           { OID id-sha224     PARAMETERS NULL }|\n>           { OID id-sha256     PARAMETERS NULL }|\n>           { OID id-sha384     PARAMETERS NULL }|\n>           { OID id-sha512     PARAMETERS NULL }|\n>           { OID id-sha512-224 PARAMETERS NULL }|\n>           { OID id-sha512-256 PARAMETERS NULL }\n>       }\n\nThus, a correctly encoded DigestInfo shall contain the NULL parameter of the AlgorithmIdentifier field, as shown in the example below:\n```\nSignatureValue : Rwu3d2y/U82j1y0ctJqXO/ODAFgoTdFlxUoiwqN91KH2LTn2aCZ8U5JNO4cAJdtMWxqpAddT0pmrNZIYIFMV0qLeVawhDVyUAYVj6/CFAfpAUjn8NV9FTGq8pGjQpidMAyODb363uG33TJebsa5useVerIhZzhgX17PvLLlbOahzzH4alDnM3+joIWU/8uytGrrgNqLF4RYOHDG2TBK3FQ8LYsZtVHdtSkFy7gw1nzD67eRciA2De5iWqxq3W4PEt3B845Kv+i9NZoGD0ss/3huFMjNU6MN4shhha6U9hcwLThNYqX0LGsUJKAmh4ZQDc7woVJA0GlC2r+inDvXb7g==\nPublic Key : MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtwrrGyhs4cyn01L1H24U5CzAX5/OY4j34JrxV2zQaHEYHl0l5JIKitzSqKOBkjKt9Mvd6BmYv69nbErqTVmJmVrVHvQrCS4MvuXqhwB/vuzzX4P3rTrZiC/6thS6OaaWOHiYj2OB/qBmTqrstHgbvdqSW4cZW4RzpW/NS7mRI5PQoXBeNM/YkNyghoT/jjHUn0+cwVUMX72DluZ+ONPWJjtTZefOszgufx82RmZ1c5m4hRpp9S5QP5hQT5i667B05uNa9U/MD1D4yw+6sg4XlIRq4t4KRaTFzHEb1ioIPsiO65r4LWwWqvyEIN35mdlS+5oJVVvEWkctIi6ki0l4swIDAQAB\nDecrypted result (b64) : MFEwDQYJYIZIAWUDBAIDBQAEQFVT9QQ6+L8Afq8FHS3WQoHbW9/65BwAzpoGJVxweSuHjf2w1+XP03I8wrWncpBHfe18egg8voonmKpXfhO0DMg=\nDecrypted result (string representation) : [[2.16.840.1.101.3.4.2.3, NULL], #5553f5043af8bf007eaf051d2dd64281db5bdffae41c00ce9a06255c70792b878dfdb0d7e5cfd3723cc2b5a77290477ded7c7a083cbe8a2798aa577e13b40cc8]\n```\n\nWhile BC intentionally (?) accepts signatures signing a wrongly encoded DigestInfo payload, omitting the NULL parameter, see an example of a such signature below:\n\n```\nSignatureValue : LWHJa8xbrrMvMtkKHBmIAH7k2kFt2N/dxqEptD5YdUDlhyo36XLmZQLBV4GTGA2PrL9i3xf/DNPbLT28CZfLoqxkJTOvTCCQ8aNzMZXh6tY8l0ukr1bqH+xboYYOojREBsEO0+QAKb7nOyj0ZiKRc52zepFvpSUFIkohCLNJJcAUIUI1R0Lv6Mipm2dq3vCCVdH80XLvTOwnnUgRjYk/QZC4PwPIgynkTk7m9RjvScqkf9+LKESopGfida/QyTtcJnAx8OaHmKZPapWrIhXAB3vfRsP9NDsxZTXk778zcsurMN2BkccMC4oFcVKt3iqlka+wg/gt8OGYJRmsi9fXvQ==\nPublic Key : MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4GdXNjzgapx6lLFUjZJS5f5rDIQE8fDr2ehYLFJSRNVOGGs/QtlxNYpsqK5K69qxPNal/gBns09vX3XCSUbKZYDXJmldNM5tmACL4O9qFCG3/u1ZCSxF8NYVu3TJ+Pwq13e51cu0MkMXdyRvr5fHE7nLuqSnrXirzTXgrQv0MaMOFtC2mplxKNGxlr9fbOMiC3rKaCoWSQwB4s9XxqdYspmJuDdH5hXlY6z/OFhlE0L6NjNDwCuOTOOucOw6Qog6PNHWtonfGS5HHYBPGX6d083dAqR8YtV0Si8qZpvrL4pMEBUpzTeQzqk0m9Vw+ZftK5jZq7qPu9Nt1v0AkdVhwQIDAQAB\nDecrypted result (b64) : ME8wCwYJYIZIAWUDBAIDBEBsbCUYxKRiYfPZARXezD4vcqGfh2fVWJgrmHGwVHv37cOMLf+AWQ+Pg5Ke30fbBXttEjH18U9VioeRxR1rFAnF\nDecrypted result (string representation) : [[2.16.840.1.101.3.4.2.3], #6c6c2518c4a46261f3d90115decc3e2f72a19f8767d558982b9871b0547bf7edc38c2dff80590f8f83929edf47db057b6d1231f5f14f558a8791c51d6b1409c5]\n```\n\nThis lenient behavior on validation causes ambiguity on validation within security critical systems relying on the BouncyCastle provider for cryptographic validation.\n\nI do not know how many incorrectly created signatures are in circulation today, but I think there shall be a way to enforce the strict validation mechanism, whether it is required by the organization policy.\n\nKR,\nAleksandr","author":{"url":"https://github.com/bsanchezb","@type":"Person","name":"bsanchezb"},"datePublished":"2026-03-20T10:36:26Z","url":"https://github.com/bcgit/bc-java/issues/2273"}

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:1aad8f9c-176b-4a04-8cd5-fcffdccd5950
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id9ABC:220F9F:1F83C0:2CBDC2:6AFBFF93
html-safe-noncef2da6059bdc72eb52c7350c6028590bacb4013ace1e474a6b505d7b6f891950c
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QUJDOjIyMEY5RjoxRjgzQzA6MkNCREMyOjZBRkJGRjkzIiwidmlzaXRvcl9pZCI6IjY3NDk0NjI3ODQ0MzUyOTAwMDMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac32dd2843b90500c5bf648af395aba669928dd448593b30d641037db1bed49fbc
hovercard-subject-tagissue:4107116723
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/2273/issue_layout
twitter:imagehttps://opengraph.githubassets.com/f592263b2aa757a28d5e81cebc7202cdf3bc89377cd0a5303c9c592de4baf2f3/bcgit/bc-java/issues/2273
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/f592263b2aa757a28d5e81cebc7202cdf3bc89377cd0a5303c9c592de4baf2f3/bcgit/bc-java/issues/2273
og:image:altHello, It looks like BouncyCastle does not implement a strict validation of RSA signatures according to the requirements stated in RFC 8017. In particular, the issue concerns the DigestSignatureSpi...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamebsanchezb
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/2273#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fbcgit%2Fbc-java%2Fissues%2F2273
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%2F2273
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/2273
Reloadhttps://github.com/bcgit/bc-java/issues/2273
Reloadhttps://github.com/bcgit/bc-java/issues/2273
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/2273
New issuehttps://github.com/login?return_to=https://github.com/bcgit/bc-java/issues/2273
Possible incompliance with RFC 8017 on RSA PKCS-v1.5 validationhttps://github.com/bcgit/bc-java/issues/2273#top
https://github.com/dghgit
enhancementNew feature or requesthttps://github.com/bcgit/bc-java/issues?q=state%3Aopen%20label%3A%22enhancement%22
https://github.com/bsanchezb
bsanchezbhttps://github.com/bsanchezb
on Mar 20, 2026https://github.com/bcgit/bc-java/issues/2273#issue-4107116723
RFC 8017https://www.rfc-editor.org/rfc/rfc8017
DigestSignatureSpihttps://github.com/bcgit/bc-java/blob/r1rv83/prov/src/main/java/org/bouncycastle/jcajce/provider/asymmetric/rsa/DigestSignatureSpi.java
A.2.2https://www.rfc-editor.org/rfc/rfc8017#appendix-A.2.2
Appendix A.1https://www.rfc-editor.org/rfc/rfc8017#appendix-A.1
#1https://github.com/bcgit/bc-java/pull/1
Appendix B.1https://www.rfc-editor.org/rfc/rfc8017#appendix-B.1
dghgithttps://github.com/dghgit
on Apr 4, 2026https://github.com/bcgit/bc-java/issues/2273#event-24193526127
https://github.com/dghgit
dghgithttps://github.com/dghgit
on May 11, 2026https://github.com/bcgit/bc-java/issues/2273#issuecomment-4417775015
https://www.bouncycastle.org/betashttps://www.bouncycastle.org/betas
dghgithttps://github.com/dghgit
completedhttps://github.com/bcgit/bc-java/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on May 11, 2026https://github.com/bcgit/bc-java/issues/2273#event-25366667900
hubothttps://github.com/hubot
on May 11, 2026https://github.com/bcgit/bc-java/issues/2273#event-25374084281
added flag for setting strict checking of DigestInfo for required NUL…https://github.com/bcgit/bc-java/commit/6ee829bbe8bd1f423f1d6ec3d272eb2b25b09a28
6ee829bhttps://github.com/bcgit/bc-java/commit/6ee829bbe8bd1f423f1d6ec3d272eb2b25b09a28
winfriedgerlachhttps://github.com/winfriedgerlach
enhancementNew feature or requesthttps://github.com/bcgit/bc-java/issues?q=state%3Aopen%20label%3A%22enhancement%22
on Jul 15, 2026https://github.com/bcgit/bc-java/issues/2273#event-28005503132
Sign up for freehttps://github.com/signup?return_to=https://github.com/bcgit/bc-java/issues/2273
Sign in to commenthttps://github.com/login?return_to=https://github.com/bcgit/bc-java/issues/2273
dghgithttps://github.com/dghgit
enhancementNew feature or requesthttps://github.com/bcgit/bc-java/issues?q=state%3Aopen%20label%3A%22enhancement%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.