-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
ask the question about mitigating or fixing Bleichenbacher attacks on RSA decryption #10506
Comments
Public exponent doesn't impact anything. If you don't use PKCS1v15 encryption, then you cannot be impacted by this issue. Whether you can stop using it depends on your code. |
@alex Thanks for your reply. (1) If I use public exponent 65537,do I still affected by the CVEs? I'm very sorry, I don't know much about this. |
The correct way to mitigate this is to use cryptography the OpenSSL 3.2.0+, either via our wheels or via your own version of OpenSSL. |
ok, thanks |
In 3.2.0 (or with implicit rejection) OpenSSL doesn't return errors, it returns a deterministically random message in case padding check fails. Since there is no error[1], pyca/crypptography doesn't raise an exception. |
The relevant code is in |
ok, thank you very much for your reply. |
This issue has been waiting for a reporter response for 3 days. It will be auto-closed if no activity occurs in the next 5 days. |
This issue has not received a reporter response and has been auto-closed. If the issue is still relevant please leave a comment and we can reopen it. |
How to determine whether the ciphertext sent by the attacker complies with the PKCS format based on the time information?
(1) openssl will return errors inpadding check fails. cryptography changes that error into an exception. |
See https://crypto.stackexchange.com/questions/12688/can-you-explain-bleichenbachers-cca-attack-on-pkcs1-v1-5 for an explanation of Bleichenhacher's attack on PKCS1v15 |
If I want to disable RSA PKCS#1v1.5 for encryption and decryption, do I just change the _enc_dec_rsa_pkey_ctx() function?
|
There's no public API for disabling PKCS#1v1.5 If you want to patch
cryptography, I suppose something like that will work, but you're on
your own.
…On Tue, Mar 12, 2024 at 7:29 AM sxt1001 ***@***.***> wrote:
If I want to disable RSA PKCS#1v1.5 for encryption and decryption, do I just change the _enc_dec_rsa_pkey_ctx() function?
if isinstance(padding, PKCS1v15):
raise ValueError("error msg")
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
--
All that is necessary for evil to succeed is for good people to do nothing.
|
Ok, thank you very much for reply. I'll look into whether there are any other problems with this change. |
Sorry, for some reason, I can't upgrade the cryptography and openssl versions, so I can't fix CVE-2023-50782 and CVE-2020-25659 by upgrading the package. The version information of the package I'm using is as follows:
cryptography:36.0.1
openssl: 1.1.1m (have a backport of the CVE-2022-4304 fix)
I have a few questions that I would like to ask:
(1)Does the CVEs get fixed or alleviated if I specify 65537 using public exponent? If yes, what would be the impact? (3 is not supported)
(2)Is there any impact of stopping PKCS#1v1.5 and using OEAP instead? Like having to switch the tls protocol to a certain version?
Looking forward to your reply, thanks.
The text was updated successfully, but these errors were encountered: