Closed tomato42 closed 1 year ago
The README acknowledges that timing attacks, like CVE-2020-25658, can never be fixed in a pure-Python implementation. Downstream users of python-rsa should be well aware that they are not safe from these attacks.
Security Because of how Python internally stores numbers, it is very hard (if not impossible) to make a pure-Python program secure against timing attacks. This library is no exception, so use it with care. See https://securitypitfalls.wordpress.com/2018/08/03/constant-time-compare-in-python/ for more info.
Perhaps Red Hat's CNA can update the CVE to explain this.
Since this project has already addressed that CVE-2020-25658 is out of their projects scope to fix, with discussion and clear documentation, I am not sure what this issue is for.
I am not sure what this issue is for.
To show that the documentation statements aren't simple assertions, but are backed by data.
I believe we should respect the security scope of this pure-Python project. python-rsa would need to change the purpose of their project to fix CVE-2020-25658.
It would be nice if it is very hard (if not impossible)
were changed to it is not possible
for clarity.
Raising awareness of this CVE is important. Downstream projects are affected by CVE-2020-25658, and issues may need to be filed to make them aware. Ideally, this could cause a dependency shift away from pure-Python. Appreciate your bandit report.
To show that the documentation statements aren't simple assertions, but are backed by data.
Much appreciated, thanks.
I've executed the scripts in the https://github.com/tomato42/marvin-toolkit/tree/master/example/python-rsa and have confirmed that the implementation of RSA decryption in python-rsa 4.9 is leaky, as predicted in issue #165.
I've executed the test with 10k repeats (note that step2-alt.sh by default generates 100k repeats) on a Ryzen 5600X CPU.
The results show a clear difference between valid and invalid ciphertexts. In other words, it is vulnerable to the Marvin Attack
summary data:
legend for the graph:
(explanations for the ciphertexts are in the step2.py file)