CVE-2022-37454: Buffer overflow in sponge queue functions

Published Oct 21, 2022
·
Updated

Impact

The Keccak sponge function interface accepts partial inputs to be absorbed and partial outputs to be squeezed. A buffer can overflow when partial data with some specific sizes are queued, where at least one of them has a length of 2^32 - 200 bytes or more.

Patches

Yes, see commit fdc6fef0.

Workarounds

The problem can be avoided by limiting the size of the partial input data (or partial output digest) below 2^32 - 200 bytes. Multiple calls to the queue system can be chained at a higher level to retain the original functionality. Alternatively, one can process the entire input (or produce the entire output) at once, avoiding the queuing functions altogether.

References

See issue #105 for more details.

Other sources

Fixed bug : buffer overflow in hashupdate() on long parameter. (CVE-2022-37454)

— PHP

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.

— Launchpad

Affected Software

60 affected componentsFixes available
debian/pysha3<=1.0.2-2, <=1.0.2-4.1, <=1.0.2-4.2
1.0.2-4.1+deb11u11.0.2-5
PHP PHP<8.0.25
8.0.25
Extended Keccak Code Package Project Extended Keccak Code Package
Debian Debian Linux=10.0
Debian Debian Linux=11.0
Fedoraproject Fedora=35
Fedoraproject Fedora=36
PHP PHP>=7.2.0<7.4.33
PHP PHP>=8.0.0<8.0.25
PHP PHP>=8.1.0<8.1.12
Python Python>=3.6.0<3.7.16
Python Python>=3.8.0<3.8.16
Python Python>=3.9.0<3.9.16
Python Python>=3.10.0<3.10.9
Sha3 Project Sha3 Ruby<1.0.5
Pysha3 Project Pysha3
Pypy Pypy>=7.0.0
pip/pysha3<=1.0.2
rubygems/sha3<1.0.5
1.0.5
ubuntu/pysha3<1.0.0-0ubuntu1~ubuntu16.04.2+esm1
1.0.0-0ubuntu1~ubuntu16.04.2+esm1
ubuntu/php7.2<7.2.24-0ubuntu0.18.04.15
7.2.24-0ubuntu0.18.04.15
ubuntu/python3.6<3.6.9-1~18.04ubuntu1.10
3.6.9-1~18.04ubuntu1.10
ubuntu/pysha3<1.0.2-2ubuntu2+esm1
1.0.2-2ubuntu2+esm1
ubuntu/python3.7<3.7.5-2ubuntu1~18.04.2+esm2
3.7.5-2ubuntu1~18.04.2+esm2
ubuntu/python3.8<3.8.0-3ubuntu1~18.04.2+esm1
3.8.0-3ubuntu1~18.04.2+esm1
ubuntu/php7.4<7.4.3-4ubuntu2.15
7.4.3-4ubuntu2.15
ubuntu/pypy3<7.3.1+dfsg-4ubuntu0.1
7.3.1+dfsg-4ubuntu0.1
ubuntu/pysha3<1.0.2-4ubuntu0.1
1.0.2-4ubuntu0.1
ubuntu/python3.8<3.8.10-0ubuntu1~20.04.6
3.8.10-0ubuntu1~20.04.6
ubuntu/python3.9<3.9.5-3ubuntu0~20.04.1+esm1
3.9.5-3ubuntu0~20.04.1+esm1
ubuntu/php8.1<8.1.2-1ubuntu2.8
8.1.2-1ubuntu2.8
ubuntu/pypy3<7.3.9+dfsg-1ubuntu0.1
7.3.9+dfsg-1ubuntu0.1
ubuntu/pysha3<1.0.2-4.2ubuntu0.22.04.1
1.0.2-4.2ubuntu0.22.04.1
ubuntu/python3.10<3.10.6-1~22.04.2
3.10.6-1~22.04.2
debian/pypy3<7.3.9+dfsg-5
7.3.9+dfsg-5
debian/pypy3<7.3.9+dfsg-5
7.3.9+dfsg-5
debian/pypy3<7.3.9+dfsg-5
7.3.9+dfsg-5
alpine/php7<7.4.33-r0
7.4.33-r0
alpine/php7<7.4.33-r0
7.4.33-r0
alpine/php8<8.0.25-r0
8.0.25-r0
alpine/php8<8.0.25-r0
8.0.25-r0
alpine/php81<8.1.12-r0
8.1.12-r0
alpine/php81<8.1.12-r0
8.1.12-r0
alpine/php81<8.1.12-r0
8.1.12-r0
alpine/php81<8.1.12-r0
8.1.12-r0
alpine/php82<8.2.0_rc5-r0
8.2.0_rc5-r0
alpine/php82<8.2.0_rc5-r0
8.2.0_rc5-r0
alpine/php82<8.2.0_rc5-r0
8.2.0_rc5-r0
alpine/php82<8.2.0_rc5-r0
8.2.0_rc5-r0
alpine/php82<8.2.0_rc5-r0
8.2.0_rc5-r0
alpine/python3<3.10.9-r0
3.10.9-r0
alpine/python3<3.10.9-r0
3.10.9-r0
debian/pypy3
7.3.5+dfsg-2+deb11u27.3.9+dfsg-5
debian/php7.3
7.3.31-1~deb10u2
debian/php7.4
7.4.33-1+deb11u1
debian/php8.1
8.1.12-1
debian/pysha3
1.0.2-2+deb10u11.0.2-4.1+deb11u11.0.2-5
debian/python3.10
3.10.9-1
debian/python3.7
3.7.3-2+deb10u4
debian/python3.9
3.9.2-1+deb11u4

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade debian/pysha3 to a version that resolves this vulnerability.

    Fixed in 1.0.2-4.1+deb11u1Fixed in 1.0.2-5
  2. Upgrade

    Upgrade PHP to a version that resolves this vulnerability.

    Fixed in 8.0.25
  3. Upgrade

    Upgrade rubygems/sha3 to a version that resolves this vulnerability.

    Fixed in 1.0.5
  4. Upgrade

    Upgrade ubuntu/pysha3 to a version that resolves this vulnerability.

    Fixed in 1.0.0-0ubuntu1~ubuntu16.04.2+esm1
  5. Upgrade

    Upgrade ubuntu/php7.2 to a version that resolves this vulnerability.

    Fixed in 7.2.24-0ubuntu0.18.04.15
  6. Upgrade

    Upgrade ubuntu/python3.6 to a version that resolves this vulnerability.

    Fixed in 3.6.9-1~18.04ubuntu1.10
  7. Upgrade

    Upgrade ubuntu/pysha3 to a version that resolves this vulnerability.

    Fixed in 1.0.2-2ubuntu2+esm1
  8. Upgrade

    Upgrade ubuntu/python3.7 to a version that resolves this vulnerability.

    Fixed in 3.7.5-2ubuntu1~18.04.2+esm2
  9. Upgrade

    Upgrade ubuntu/python3.8 to a version that resolves this vulnerability.

    Fixed in 3.8.0-3ubuntu1~18.04.2+esm1
  10. Upgrade

    Upgrade ubuntu/php7.4 to a version that resolves this vulnerability.

    Fixed in 7.4.3-4ubuntu2.15
  11. Upgrade

    Upgrade ubuntu/pypy3 to a version that resolves this vulnerability.

    Fixed in 7.3.1+dfsg-4ubuntu0.1
  12. Upgrade

    Upgrade ubuntu/pysha3 to a version that resolves this vulnerability.

    Fixed in 1.0.2-4ubuntu0.1
  13. Upgrade

    Upgrade ubuntu/python3.8 to a version that resolves this vulnerability.

    Fixed in 3.8.10-0ubuntu1~20.04.6
  14. Upgrade

    Upgrade ubuntu/python3.9 to a version that resolves this vulnerability.

    Fixed in 3.9.5-3ubuntu0~20.04.1+esm1
  15. Upgrade

    Upgrade ubuntu/php8.1 to a version that resolves this vulnerability.

    Fixed in 8.1.2-1ubuntu2.8
  16. Upgrade

    Upgrade ubuntu/pypy3 to a version that resolves this vulnerability.

    Fixed in 7.3.9+dfsg-1ubuntu0.1
  17. Upgrade

    Upgrade ubuntu/pysha3 to a version that resolves this vulnerability.

    Fixed in 1.0.2-4.2ubuntu0.22.04.1
  18. Upgrade

    Upgrade ubuntu/python3.10 to a version that resolves this vulnerability.

    Fixed in 3.10.6-1~22.04.2
  19. Upgrade

    Upgrade debian/pypy3 to a version that resolves this vulnerability.

    Fixed in 7.3.9+dfsg-5
  20. Upgrade

    Upgrade alpine/php7 to a version that resolves this vulnerability.

    Fixed in 7.4.33-r0
  21. Upgrade

    Upgrade alpine/php8 to a version that resolves this vulnerability.

    Fixed in 8.0.25-r0
  22. Upgrade

    Upgrade alpine/php81 to a version that resolves this vulnerability.

    Fixed in 8.1.12-r0
  23. Upgrade

    Upgrade alpine/php82 to a version that resolves this vulnerability.

    Fixed in 8.2.0_rc5-r0
  24. Upgrade

    Upgrade alpine/python3 to a version that resolves this vulnerability.

    Fixed in 3.10.9-r0
  25. Upgrade

    Upgrade debian/pypy3 to a version that resolves this vulnerability.

    Fixed in 7.3.5+dfsg-2+deb11u2Fixed in 7.3.9+dfsg-5
  26. Upgrade

    Upgrade debian/php7.3 to a version that resolves this vulnerability.

    Fixed in 7.3.31-1~deb10u2
  27. Upgrade

    Upgrade debian/php7.4 to a version that resolves this vulnerability.

    Fixed in 7.4.33-1+deb11u1
  28. Upgrade

    Upgrade debian/php8.1 to a version that resolves this vulnerability.

    Fixed in 8.1.12-1
  29. Upgrade

    Upgrade debian/pysha3 to a version that resolves this vulnerability.

    Fixed in 1.0.2-2+deb10u1Fixed in 1.0.2-4.1+deb11u1Fixed in 1.0.2-5
  30. Upgrade

    Upgrade debian/python3.10 to a version that resolves this vulnerability.

    Fixed in 3.10.9-1
  31. Upgrade

    Upgrade debian/python3.7 to a version that resolves this vulnerability.

    Fixed in 3.7.3-2+deb10u4
  32. Upgrade

    Upgrade debian/python3.9 to a version that resolves this vulnerability.

    Fixed in 3.9.2-1+deb11u4
  33. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Patch fdc6fef075f4e81d6b1bc38364248975e08e340a
  34. Compensating control

    Until patched, avoid the sponge queue functions by processing the entire input or output at once, or keep each partial input or output below 2^32 - 200 bytes. To retain queue functionality, chain multiple calls to the queue system at a higher level.

Event History

Oct 21, 2022
CVE Published
via MITRE·12:00 AM
Data Sourced
12:00 AM
RemedyDescriptionSeverityAffected Software
Data Sourced
via MITRE·12:00 AM
Description
Data Sourced
via OSV·12:00 AM
DescriptionSeverity
Updated
12:00 AM
Affected Software
Updated
via Ubuntu·12:00 AM
RemedyDescriptionAffected Software
Oct 27, 2022
Updated
12:00 AM
Affected Software
Nov 3, 2022
Data Sourced
via PHP·12:00 AM
DescriptionAffected Software
Updated
12:00 AM
Affected Software
Nov 4, 2022
Data Sourced
via Red Hat·07:16 PM
DescriptionSeverityAffected Software
Dec 8, 2022
Updated
12:00 AM
Affected Software
Apr 26, 2023
Advisory Published
via OSV·05:39 PM
Data Sourced
via OSV·05:39 PM
Weakness
May 3, 2023
Data Sourced
11:15 AM
Weakness
Data Sourced
via NVD·11:15 AM
RemedyDescriptionSeverityWeaknessAffected Software
Updated
11:15 AM
Affected Software
Nov 21, 2024
Updated
via NVD·07:15 AM
RemedyAffected Software
May 8, 2025
Updated
via NVD·03:15 PM
SeverityWeaknessAffected Software
Oct 14, 2026
Updated
via NVD·06:17 PM
Affected Software
Nov 17, 2026
Data Sourced
via OSV·04:00 AM
Affected Software
Nov 18, 2026
Updated
via OSV·12:57 AM
Affected Software

Parent advisories

This vulnerability appears in the following advisories.

Peer vulnerabilities

Found alongside the following vulnerabilities.

Frequently Asked Questions

1

What is CVE-2022-37454?

CVE-2022-37454 is a fixed bug in the Keccak XKCP SHA-3 reference implementation that allows attackers to execute arbitrary code or eliminate expected cryptographic properties.

2

How does CVE-2022-37454 impact PHP?

CVE-2022-37454 affects PHP versions up to 7.4.33 and can be exploited to execute arbitrary code.

3

How can I fix CVE-2022-37454 in PHP?

To fix CVE-2022-37454 in PHP, update to version 7.4.33 or later.

4

What is the affected software for CVE-2022-37454?

The affected software includes PHP versions up to 7.4.33, PHP 7.3.31-1~deb10u4, PHP 7.4.33-1+deb11u3 and 7.4.33-1+deb11u4, PyPy3 versions 7.0.0+dfsg-3, 7.3.5+dfsg-2+deb11u2, 7.3.11+dfsg-2, and 7.3.12+dfsg-1, pysha3 versions 1.0.2-2+deb10u1 and 1.0.2-4.1+deb11u1, Python 2.7.16-2+deb10u1, 2.7.16-2+deb10u2, and 2.7.18-8, Python 3.10.12-1, Python 3.7.3-2+deb10u5, and Python 3.9 versions up to 3.9.2-1.

5

Where can I find more information about CVE-2022-37454?

More information about CVE-2022-37454 can be found in the PHP changelog at https://www.php.net/ChangeLog-7.php#7.4.33 and the XKCP/XKCP GitHub repository at https://github.com/XKCP/XKCP/security/advisories/GHSA-6w4m-2xhg-2658. The specific fix is available in the commit fdc6fef075f4e81d6b1bc38364248975e08e340a.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203