]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.7] gh-98517: Fix buffer overflows in _sha3 module (GH-98519) (GH-98528)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sat, 22 Oct 2022 03:37:54 +0000 (20:37 -0700)
committerGitHub <noreply@github.com>
Sat, 22 Oct 2022 03:37:54 +0000 (23:37 -0400)
commit8088c90044ba04cd5624b278340ebf934dbee4a5
treeb8e6981f0f8a5ea9f96ead58e7a4415fb00defce
parente7fe11186504ec59937a3364cf62e76848d32361
[3.7] gh-98517: Fix buffer overflows in _sha3 module (GH-98519) (GH-98528)

This is a port of the applicable part of XKCP's fix [1] for
CVE-2022-37454 and avoids the segmentation fault and the infinite
loop in the test cases published in [2].

[1]: https://github.com/XKCP/XKCP/commit/fdc6fef075f4e81d6b1bc38364248975e08e340a
[2]: https://mouha.be/sha-3-buffer-overflow/

Regression test added by: Gregory P. Smith [Google LLC] <greg@krypto.org>
(cherry picked from commit 0e4e058602d93b88256ff90bbef501ba20be9dd3)

Co-authored-by: Theo Buehler <botovq@users.noreply.github.com>
Lib/test/test_hashlib.py
Misc/NEWS.d/next/Security/2022-10-21-13-31-47.gh-issue-98517.SXXGfV.rst [new file with mode: 0644]
Modules/_sha3/kcp/KeccakSponge.inc