.. _sha3-buffer-overflow: Buffer overflow in the _sha3 module in Python 3.10 and older ============================================================ .. warning:: This resource is maintained for historical reference and **does not contain the latest vulnerability info for Python**. The `canonical database for vulnerabilities affecting Python `_ is available on GitHub in the Open Source Vulnerability (OSV) format. This vulnerability can be viewed online at the `Open Source Vulnerability Database `_. CVE-2022-37454 affects Python versions prior to 3.11. The fix discussed in `XKCP's advisory `_ can be adapted to these versions. The discoverer's writeup contains code that might be turned into regression tests. Python 3.11 is not affected: Python 3.11 switched to using tiny_sha3 in `issue GH-91254 `_. The XKCP vulnerability has been found by Nicky Mouha. Dates: * Disclosure date: **2022-10-21** (Python issue gh-98517 reported) Fixed In -------- * Python **3.7.16** (2022-12-06) fixed by `commit 8088c90 (branch 3.7) `_ (2022-10-22) * Python **3.8.16** (2022-12-06) fixed by `commit 948c679 (branch 3.8) `_ (2022-10-28) * Python **3.9.16** (2022-12-06) fixed by `commit 857efee (branch 3.9) `_ (2022-10-28) * Python **3.10.9** (2022-12-06) fixed by `commit 0e4e058 (branch 3.10) `_ (2022-10-21) Python issue ------------ [CVE-2022-37454] Buffer overflow in the _sha3 module in python versions <= 3.10. * Python issue: `gh-98517 `_ * Creation date: 2022-10-21 * Reporter: botovq CVE-2022-37454 -------------- The Keccak XKCP SHA-3 reference implementation before fdc6fef has an integer overflow and resultant buffer overflow that allows attackers to execute arbitrary code or eliminate expected cryptographic properties. This occurs in the sponge function interface. * CVE ID: `CVE-2022-37454 `_ * Published: 2022-10-21 Timeline -------- Timeline using the disclosure date **2022-10-21** as reference: * 2022-10-21: `Python issue gh-98517 `_ reported by botovq * 2022-10-21: CVE-2022-37454 published * 2022-10-21: `commit 0e4e058 (branch 3.10) `_ * 2022-10-22 (**+1 days**): `commit 8088c90 (branch 3.7) `_ * 2022-10-28 (**+7 days**): `commit 857efee (branch 3.9) `_ * 2022-10-28 (**+7 days**): `commit 948c679 (branch 3.8) `_ * 2022-12-06 (**+46 days**): Python 3.10.9 released * 2022-12-06 (**+46 days**): Python 3.7.16 released * 2022-12-06 (**+46 days**): Python 3.8.16 released * 2022-12-06 (**+46 days**): Python 3.9.16 released Links ----- * https://github.com/XKCP/XKCP/security/advisories/GHSA-6w4m-2xhg-2658 * {'openSUSE': 'https://bugzilla.suse.com/show_bug.cgi?id=CVE-2022-37454'} * https://mouha.be/sha-3-buffer-overflow/ * https://nvd.nist.gov/vuln/detail/CVE-2022-37454/