PYSHA3 · CVE-2022-37454 · Package
FIX → 1.0.5 · 8.1.12 · 7.4.33 · 3.10.9 +4
The sha3 Ruby gem and pysha3 Python package, which wrap the Keccak sponge code, can overflow a buffer when partial input of about 2^32 - 200 bytes or more is queued. An attacker who controls that input may be able to corrupt memory and run code.
first public Oct 20, 2022 · 1 public exploit · 2 sources
Check it with your coding agent
It reads this page and tells you if your code or app is affected.
Applications that pass very large partial inputs or outputs through the sha3 or pysha3 queue functions are exposed, especially if the sizes come from untrusted users. Code that hashes whole inputs in one call, or caps input sizes well below 2^32 - 200 bytes, is not affected by the flaw as described.
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.
Yes, see commit fdc6fef0.
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.
See issue #105 for more details.
Are you affected?
Ask from here. InfraStack checks the affected versions against your stack and answers in your inbox.
InfraStack checks the affected versions against your stack and answers in Slack, with the evidence and the fix.
InfraStack checks it against your stack and answers on your report, with the evidence and the fix.
Not affected if default-config, input-size-capped
Who cares pysha3, python, ruby, sha3
sha3 gem version with gem list sha3; affected below 1.0.5.pysha3 version with pip show pysha3; affected at 1.0.2 and below.Upgrade to 1.0.5 · 8.1.12 · 7.4.33 · 3.10.9 +4
sha3 (RubyGems): 1.0.5pysha3 (PyPI): unknownGitHub Advisory Database, CC-BY 4.0 · NVD data is provided by NIST and is public domain. Posts quoted belong to their authors.