CVE-2022-37454: pysha3 Buffer Overflow Vulnerability in Sponge Queue Functions

pysha3 Updated 29 Jun 2026

Summary

29/06/2026
No i
Critical
9.8

CVE-2022-37454: Buffer overflow in sponge queue functions. Affects pysha3 versions < 1.0.2. No fix is published. How to fix ↓

Also tracked for

The same CVE-2022-37454 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

pysha3 is a Python library that provides implementations of the SHA-3 family of cryptographic hash functions, including Keccak. It is widely used for secure hashing in various applications. However, the library has a vulnerability that can lead to a buffer overflow when handling specific input sizes, potentially compromising the integrity and security of applications that rely on it.

Vulnerability Detail

The vulnerability arises from the Keccak sponge function interface, which allows for the absorption of partial inputs and the squeezing of partial outputs. When partial data with certain sizes is queued, particularly when one of the inputs is 2^32 - 200 bytes or larger, it can lead to a buffer overflow. This overflow can result in unexpected behavior, data corruption, or even arbitrary code execution, posing significant risks to applications utilizing this library.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

As a temporary workaround, limit the size of the partial input data or output digest to below 2^32 - 200 bytes. You can also process the entire input or output at once, avoiding the queuing functions altogether. Here is an example of how to limit input size:

if len(partial_input) < (2**32 - 200):
    sponge.queue(partial_input)
else:
    # Handle input differently or raise an error

Conclusion

CVE-2022-37454 is a critical buffer overflow vulnerability in the pysha3 library that can lead to severe security risks. It is essential to update the library to the patched version or implement workarounds to mitigate the risks associated with this vulnerability.

See every vulnerability recorded for pysha3 →

Share this vulnerability

FAQ

CVE-2022-37454 is a vulnerability in the pysha3 library that can lead to a buffer overflow when specific input sizes are processed.

If your application uses the pysha3 library and processes large inputs, it may be at risk of data corruption or arbitrary code execution due to this vulnerability.

You can implement a workaround by limiting the size of the input data or processing the entire input at once to avoid using the vulnerable queuing functions.

You can refer to the GitHub issue #105 for detailed discussions and updates regarding CVE-2022-37454.

Vulert monitors and alerts you in real-time for open-source vulnerabilities in your software using just the Pipfile.lock. You can check if your application is affected by this vulnerability using the Vulert playground without any signup.

Related vulnerabilities

Recent vulnerabilities recorded for pysha3.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback