Skip to content
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

Mark use of PKCS1v15 for encryption and decryption a vulnerability #1071

Open
tomato42 opened this issue Oct 26, 2023 · 3 comments
Open

Mark use of PKCS1v15 for encryption and decryption a vulnerability #1071

tomato42 opened this issue Oct 26, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@tomato42
Copy link

Is your feature request related to a problem? Please describe.
While pyca/cryptography is generally a high quality wrapper around OpenSSL, because of peculiarities of Python it is impossible to handle PKCS#1 v1.5 decryption failures in side channel free manner. As such, all usages of it will leak information useful in mounting the Bleichenbacher/Marvin attack: pyca/cryptography#9785

Describe the solution you'd like
Any use of the cryptography.hazmat.primitives.asymmetric.padding.PKCS1v15 for decryption (or encryption) should be marked as vulnerabilities.

Describe alternatives you've considered
it's impossible to handle exceptions in Python in side-channel free manner
the PKCS#1 v1.5 is known to be insecure for over 25 years at this point, it's high time to stop use of it

the alternative is to use RSA-OAEP encryption

Additional context
https://people.redhat.com/~hkario/marvin/

Love this idea? Give it a 👍. We prioritize fulfilling features with the most 👍.

@tomato42 tomato42 added the enhancement New feature or request label Oct 26, 2023
@tomato42
Copy link
Author

Same thing applies to python-rsa package: sybrenstuvel/python-rsa#230 but then, use of any private keys with it is insecure: https://github.com/sybrenstuvel/python-rsa#security not just PKCS#1 v1.5 decryption

@tomato42
Copy link
Author

Same thing applies to the M2Crypto library: https://gitlab.com/m2crypto/m2crypto/-/issues/342

@tomato42
Copy link
Author

The M2Crypto issue has been assigned CVE-2023-50781, the pyca/cryptography issue has been assigned CVE-2023-50782

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant