Repository navigation
Release 4.5.post1: CVE-2020-25658 for the Python 2.7 line - #3
Closed
icanhasmath wants to merge 3 commits into
Closed
icanhasmath wants to merge 3 commits into
icanhasmath wants to merge 3 commits into
Conversation
The fork's earlier backport (PR #1) ported upstream dae8ce0 only. Upstream 4.7 refined it in two follow-ups, ported here: - 341e5c4: the ciphertext length check raises at once. Length and block size are public, so they need no side-channel-free comparison. - f254895: bytes.find() instead of bytes.index() with a ValueError handler, so a missing separator takes the same path as a present one. Also drops the unused 'import sys' that PR #1 added, and adds regression tests that every malformed cleartext (bad 00 02 marker, no separator, over-long ciphertext) still raises DecryptionError through the combined check. Python 2.7: hmac.compare_digest exists from 2.7.7.
… (upstream f878c37) RFC 8017 section 7.2.2 step 3 requires at least 8 bytes of padding, so the 00 separator must sit at index 10 or later. decrypt() accepted any separator after the marker. Part of upstream 4.7's decryption hardening alongside the CVE-2020-25658 fix. Upstream's test, without its Python 3 type annotation.
… 2.7 line Sets the version to 4.5.post1 (the branch still said 4.3, the tag 4.5 was cut from) and restores the 4.3 & 4.5 changelog section that the CVE-2020-25658 backport had rewritten, with a 4.5.post1 section on top.
Author
|
Superseded by #4: the same release rebuilt on the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
rsa 4.5.post1: Python 2.7 security release
rsa 4.5 is the last release that supports Python 2.7. It is still exposed to CVE-2020-25658 (GHSA-xrx6-fmxq-rjj2, high), a Bleichenbacher-style timing oracle in PKCS#1 v1.5 decryption. Upstream fixed it only in 4.7, which needs Python 3. This branch was opened for that fix in 2023 (#1, #2) but was never released: it still says version 4.3.
This PR finishes the backport and cuts the release.
decrypt()to upstream 4.7's final form. #1 ported upstreamdae8ce0only; this adds341e5c4(the public length check raises at once) andf254895(find()instead ofindex()/ValueError, so a missing separator takes the same path). Drops the unusedimport sysfrom #1. Adds regression tests that every malformed cleartext still raisesDecryptionError.f878c37): reject padding shorter than 8 bytes (RFC 8017 7.2.2 step 3). Upstream's test, without its Python 3 annotation.4.5.post1inrsa/__init__.pyandsetup.py. The 4.3 & 4.5 changelog section, which #1 had rewritten, is restored, with a 4.5.post1 section on top.Advisories against rsa
OSV lists nothing against 4.7 through 4.9.1, so no later upstream fix needs carrying.
Verification (Python 2.7.18)
tests/: 97 passed. The base branch has 92; the 5 new tests account for the rest.PaddingSizeTestfails without thepkcs1.pychange and passes with it.setup.py sdist bdist_wheelgivesrsa-4.5.post1.tar.gzandrsa-4.5.post1-py2.py3-none-any.whl.rsa.__version__is4.5.post1.After merge: tag
version-4.5.post1(the repo's tag style), a GitHub release (--latest=false), inventoryrsa 4.5.0.1, and a CVE-scanner override row for CVE-2020-25658.