-
-
Notifications
You must be signed in to change notification settings - Fork 645
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
jsrsasign vulnerable to the Marvin Attack #598
Comments
@tomato42 , thank you for your report. I'll investigate and try to fix it. |
Hi @tomato42 , I've just released jsrsasign 11.0.0. RSA and RSAOAEP encryption/decryption functions have been removed. I'm talking with Synk for CVE number coordination and I'll publish security advisory for it. Thank you. |
Its security advisory is published. |
kyeah
pushed a commit
to CMSgov/dpc-app
that referenced
this issue
Apr 2, 2024
<p>This PR was automatically created by Snyk using the credentials of a real user.</p><br /><h3>Snyk has created this PR to upgrade jsrsasign from 11.0.0 to 11.1.0.</h3> :information_source: Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project. <hr/> - The recommended version is **1 version** ahead of your current version. - The recommended version was released **2 months ago**, on 2024-02-01. <details> <summary><b>Release notes</b></summary> <br/> <details> <summary>Package name: <b>jsrsasign</b></summary> <ul> <li> <b>11.1.0</b> - <a href="https://snyk.io/redirect/github/kjur/jsrsasign/releases/tag/11.1.0">2024-02-01</a></br><ul> <li>Changes from 11.0.0 to 11.1.0 (2024-Feb-01) <ul> <li>src/crypto.js <ul> <li>restore KJUR.crypto.Cipher class without RSA and RSAOAEP encryption/decryption support</li> </ul> </li> </ul> </li> </ul> </li> <li> <b>11.0.0</b> - <a href="https://snyk.io/redirect/github/kjur/jsrsasign/releases/tag/11.0.0">2024-01-16</a></br><ul> <li>Changes from 10.9.0 to 11.0.0 (2024-Jan-16) <ul> <li>remove RSA PKCS#1.5 end OAEP encryption/decryption for Marvin attack (<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="2003900052" data-permission-text="Title is private" data-url="kjur/jsrsasign#598" data-hovercard-type="issue" data-hovercard-url="/kjur/jsrsasign/issues/598/hovercard" href="https://snyk.io/redirect/github/kjur/jsrsasign/issues/598">#598</a>)</li> <li>src/crypto.js <ul> <li>remove KJUR.crypto.Cipher class for RSA and RSAOAEP encryption/decryption</li> </ul> </li> <li>ext/{rsa,rsa2}.js<br> remove encrypt/decrypt/encryptOAEP/decryptOAEP for RSAKey class</li> </ul> </li> </ul> </li> </ul> from <a href="https://snyk.io/redirect/github/kjur/jsrsasign/releases">jsrsasign GitHub release notes</a> </details> </details> <details> <summary><b>Commit messages</b></summary> </br> <details> <summary>Package name: <b>jsrsasign</b></summary> <ul> <li><a href="https://snyk.io/redirect/github/kjur/jsrsasign/commit/58bb24192f501927014b67911bbde8ef27532319">58bb241</a> 11.1.0 release</li> <li><a href="https://snyk.io/redirect/github/kjur/jsrsasign/commit/726c216efacbaa42461d5c8d2ccdefc303ed1fdd">726c216</a> update readme</li> <li><a href="https://snyk.io/redirect/github/kjur/jsrsasign/commit/3f1def8b37e782c7c5b33fadd5636e21227ecf1f">3f1def8</a> update readme</li> </ul> <a href="https://snyk.io/redirect/github/kjur/jsrsasign/compare/d73befc129a1a344fa7dc3f672a9b813528fb197...58bb24192f501927014b67911bbde8ef27532319">Compare</a> </details> </details> <hr/> **Note:** *You are seeing this because you or someone else with access to this repository has authorized Snyk to open upgrade PRs.* For more information: <img src="https://api.segment.io/v1/pixel/track?data=eyJ3cml0ZUtleSI6InJyWmxZcEdHY2RyTHZsb0lYd0dUcVg4WkFRTnNCOUEwIiwiYW5vbnltb3VzSWQiOiIxZDA3MGQzNC1iOTk1LTRjNDMtYWY0OS0xYjM0YzY3YzYxYWIiLCJldmVudCI6IlBSIHZpZXdlZCIsInByb3BlcnRpZXMiOnsicHJJZCI6IjFkMDcwZDM0LWI5OTUtNGM0My1hZjQ5LTFiMzRjNjdjNjFhYiJ9fQ==" width="0" height="0"/> 🧐 [View latest project report](https://app.snyk.io/org/oeda/project/e1f69e43-ca23-488e-a32f-15f5c4b559f3?utm_source=github&utm_medium=referral&page=upgrade-pr) 🛠 [Adjust upgrade PR settings](https://app.snyk.io/org/oeda/project/e1f69e43-ca23-488e-a32f-15f5c4b559f3/settings/integration?utm_source=github&utm_medium=referral&page=upgrade-pr) 🔕 [Ignore this dependency or unsubscribe from future upgrade PRs](https://app.snyk.io/org/oeda/project/e1f69e43-ca23-488e-a32f-15f5c4b559f3/settings/integration?pkg=jsrsasign&utm_source=github&utm_medium=referral&page=upgrade-pr#auto-dep-upgrades) <!--- (snyk:metadata:{"prId":"1d070d34-b995-4c43-af49-1b34c67c61ab","prPublicId":"1d070d34-b995-4c43-af49-1b34c67c61ab","dependencies":[{"name":"jsrsasign","from":"11.0.0","to":"11.1.0"}],"packageManager":"npm","type":"auto","projectUrl":"https://app.snyk.io/org/oeda/project/e1f69e43-ca23-488e-a32f-15f5c4b559f3?utm_source=github&utm_medium=referral&page=upgrade-pr","projectPublicId":"e1f69e43-ca23-488e-a32f-15f5c4b559f3","env":"prod","prType":"upgrade","vulns":[],"issuesToFix":[],"upgrade":[],"upgradeInfo":{"versionsDiff":1,"publishedDate":"2024-02-01T22:43:20.799Z"},"templateVariants":[],"hasFixes":false,"isMajorUpgrade":false,"isBreakingChange":false,"priorityScoreList":[]}) ---> Co-authored-by: snyk-bot <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
(Since I haven't found a security policy that would ask for filing security issues over email, I'm making a regular bug report)
I've tested jsrsasign 10.8.6 on nodejs 21.1.0 and I have found it vulnerable to the Marvin Attack.
Looking at the results, both the bit size of the raw RSA decryption is leaking (so all padding modes will be vulnerable, both PKCS#1 v1.5 and OAEP), and in case of PKCS#1 v1.5 the size of the decrypted message is leaking. As such, it provides timing oracles useful in mounting a timing variant of the Bleichenbacher attack.
I've collected 10000 measurements per sample on an isolated core of an AMD Ryzen 5 5600X.
The test returned statistically significant results even with 100 measurements per sample, I've executed with with 10000 to look for side channels other then the bit size of the raw RSA operation. That means that the returned p-values are 0, as they are smaller in reality than a double precision floating point numbers can represent.
For 100k measurements the summary looks as follows:
and the confidence interval graph for the individual probes:
Legend to the graph:
Explanation for the ciphertexts is in the step2.py file.
Side note: the
valid_246
probe is actually invalid, it has padding string of 7 bytes, which is less than the mandatory 8.The reproducer I used for the test:
It can be used in similar way as the python reproducer but in the extract step you need to additionally specify
--binary 4
.The text was updated successfully, but these errors were encountered: