Skip to content

Fix for CVE-2020-25658 - #1

Merged
icanhasmath merged 1 commit into
version-4.3.xfrom
BE-162-CVE-2020-25658
Jul 14, 2023
Merged

icanhasmath merged 1 commit into
version-4.3.xfrom
BE-162-CVE-2020-25658

Conversation

@rickprice

Copy link
Copy Markdown

Fix sybrenstuvel#165: CVE-2020-25658 - Bleichenbacher-style timing oracle

Use as many constant-time comparisons as practical in the rsa.pkcs1.decrypt function.

cleartext.index(b'\x00', 2) will still be non-constant-time. The alternative would be to iterate over all the data byte by byte in Python, which is several orders of magnitude slower. Given that a perfect constant-time implementation is very hard or even impossible to do in Python 1, I chose the more performant option here.

Fix sybrenstuvel#165: CVE-2020-25658 - Bleichenbacher-style timing oracle

Use as many constant-time comparisons as practical in the
`rsa.pkcs1.decrypt` function.

`cleartext.index(b'\x00', 2)` will still be non-constant-time. The
alternative would be to iterate over all the data byte by byte in
Python, which is several orders of magnitude slower. Given that a
perfect constant-time implementation is very hard or even impossible to
do in Python [1], I chose the more performant option here.

[1]: https://securitypitfalls.wordpress.com/2018/08/03/constant-time-compare-in-python/
@rickprice
rickprice requested a review from icanhasmath July 14, 2023 04:01

@icanhasmath icanhasmath left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants