{"id":"CVE-2022-37454","kind":"vulnerability","aliases":["CVE-2022-37454","GHSA-6w4m-2xhg-2658"],"related":[],"title":"Buffer overflow in sponge queue functions","description":"### Impact\n\nThe 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.\n\n### Patches\n\nYes, see commit [fdc6fef0](https://github.com/XKCP/XKCP/commit/fdc6fef075f4e81d6b1bc38364248975e08e340a).\n\n### Workarounds\n\nThe 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.\n\n### References\n\nSee [issue #105](https://github.com/XKCP/XKCP/issues/105) for more details.","summary":"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.","severity":"critical","cvss":9.8,"epss":0.07413,"exploited":false,"exploited_at":null,"products":[{"name":"pysha3","fixed":[],"affected":"<= 1.0.2","ecosystem":"pypi"},{"name":"sha3","fixed":["1.0.5"],"affected":"< 1.0.5","ecosystem":"rubygems"},{"name":"extended keccak code package project extended keccak code package","fixed":[],"affected":"","ecosystem":"vendor"},{"name":"debian linux","fixed":[],"affected":"= 10.0","ecosystem":"vendor"},{"name":"debian linux","fixed":[],"affected":"= 11.0","ecosystem":"vendor"},{"name":"fedoraproject fedora","fixed":[],"affected":"= 35","ecosystem":"vendor"},{"name":"fedoraproject fedora","fixed":[],"affected":"= 36","ecosystem":"vendor"},{"name":"php","fixed":["7.4.33"],"affected":">= 7.2.0, < 7.4.33","ecosystem":"vendor"},{"name":"php","fixed":["8.0.25"],"affected":">= 8.0.0, < 8.0.25","ecosystem":"vendor"},{"name":"php","fixed":["8.1.12"],"affected":">= 8.1.0, < 8.1.12","ecosystem":"vendor"},{"name":"python","fixed":["3.7.16"],"affected":">= 3.6.0, < 3.7.16","ecosystem":"vendor"},{"name":"python","fixed":["3.8.16"],"affected":">= 3.8.0, < 3.8.16","ecosystem":"vendor"},{"name":"python","fixed":["3.9.16"],"affected":">= 3.9.0, < 3.9.16","ecosystem":"vendor"},{"name":"python","fixed":["3.10.9"],"affected":">= 3.10.0, < 3.10.9","ecosystem":"vendor"},{"name":"sha3 project sha3","fixed":["1.0.5"],"affected":"< 1.0.5","ecosystem":"vendor"},{"name":"pysha3 project pysha3","fixed":[],"affected":"","ecosystem":"vendor"},{"name":"pypy","fixed":[],"affected":">= 7.0.0","ecosystem":"vendor"}],"ecosystems":["pypi","rubygems","vendor"],"tags":["cwe-190","package","pysha3","python","ruby","sha3"],"not_affected_if":["default-config","input-size-capped"],"how_to_check":"- Check the installed `sha3` gem version with `gem list sha3`; affected below `1.0.5`.\n- Check the installed `pysha3` version with `pip show pysha3`; affected at `1.0.2` and below.\n- Look for code that calls the queue (partial absorb or squeeze) functions with very large inputs fed from outside.","fix":"- `sha3` (RubyGems): `1.0.5`\n- `pysha3` (PyPI): unknown","status":"open","published_at":"2022-10-21T06:15:09+00:00","first_seen_at":"2026-11-16T16:08:25+00:00","triaged_at":"2026-11-16T16:08:54+00:00","updated_at":"2026-11-16T16:38:06+00:00","category":"package","confidence":0.7,"triage":{"at":"2026-11-16T16:08:54Z","model":"claude-haiku-5-5","output":{"fix":"- `sha3` (RubyGems): `1.0.5`\n- `pysha3` (PyPI): unknown","reach":"unknown","title":"sha3 Ruby and pysha3 Python: buffer overflow in queued Keccak input","impact":"high","summary":"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.","audience":"developers","category":"package","nicknames":[],"who_cares":["ruby","python","sha3","pysha3"],"confidence":0.7,"fix_status":"available","needs_auth":"unknown","worst_case":"memory corruption, possibly code execution in the calling process","analyst_note":"Confirm the fixed pysha3 version in the PyPI advisory and whether any triggering input is reachable from outside the application.","how_to_check":"- Check the installed `sha3` gem version with `gem list sha3`; affected below `1.0.5`.\n- Check the installed `pysha3` version with `pip show pysha3`; affected at `1.0.2` and below.\n- Look for code that calls the queue (partial absorb or squeeze) functions with very large inputs fed from outside.","plain_action":"","product_name":"","needs_analyst":true,"not_affected_if":["default-config","input-size-capped"],"who_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.","user_interaction":"no","product_ecosystem":"","needs_special_setup":"unknown","severity_if_unknown":"critical"},"cost_usd":0.000805,"input_tokens":4846,"output_tokens":640,"severity_before":"critical"},"analyst_status":null,"analyst_note":null,"search":"'-190':52B '-2022':8A,16A '-37454':9A,17A '/xkcp/xkcp/commit/fdc6fef075f4e81d6b1bc38364248975e08e340a).':158C '/xkcp/xkcp/issues/105)':226C '105':223C '2':81B,145C,179C '200':83B,147C,181C '2658':14A '2xhg':13A '32':82B,146C,180C '6w4m':12A 'abl':97B 'absorb':115C 'accept':110C 'altern':201C 'altogeth':219C 'attack':90B 'avoid':164C,215C 'buffer':1A,75B,123C 'byte':84B,148C,182C 'call':184C 'chain':191C 'code':22A,27A,71B,103B 'commit':154C 'control':92B 'corrupt':99B 'cve':7A,15A 'cwe':51B 'data':128C,173C 'debian':29A,31A 'detail':229C 'digest':177C 'entir':206C,211C 'extended':20A,25A 'fdc6fef0':155C 'fedora':34A,36A 'fedoraproject':33A,35A 'function':6A,108C,200C,218C 'gem':61B 'ghsa':11A 'ghsa-6w4m-2xhg':10A 'github.com':157C,225C 'github.com/xkcp/xkcp/commit/fdc6fef075f4e81d6b1bc38364248975e08e340a).':156C 'github.com/xkcp/xkcp/issues/105)':224C 'higher':194C 'impact':104C 'input':78B,94B,112C,172C,207C 'interfac':109C 'issu':222C 'keccak':21A,26A,69B,106C 'least':137C 'length':143C 'level':195C 'limit':166C 'linux':30A,32A 'may':95B 'memori':100B 'multipl':183C 'one':138C,202C 'origin':199C 'output':118C,176C,212C 'overflow':2A,73B,125C 'packag':53B,65B 'package':23A,28A 'partial':77B,111C,117C,127C,171C,175C 'patch':151C 'php':37A,38A,39A 'problem':161C 'process':204C 'produc':209C 'project':24A,45A,48A 'pypy':50A 'pysha3':18A,47A,49A,54B,63B 'python':40A,41A,42A,43A,55B,64B 'queu':88B,134C,217C 'queue':5A,187C 'refer':220C 'retain':197C 'rubi':56B,60B 'run':102B 'see':153C,221C 'sha3':19A,44A,46A,57B,59B 'size':132C,168C 'specif':131C 'spong':4A,70B,107C 'squeez':121C 'system':188C 'workaround':159C 'wrap':67B 'yes':152C","nicknames":[],"mitigations":[],"who_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.","tier":"B","verified":{},"analyst_revisit_at":null,"fix_status":"available","audience":"developers","plain_action":null,"pkeys":["debianlinux","extendedkeccakcodepackageprojectextendedkeccakcodepackage","fedora","fedoraprojectfedora","keccakcodepackageprojectextendedkeccakcodepackage","linux","php","projectpysha3","projectsha3","pypy","pysha3","pysha3projectpysha3","python","sha3","sha3projectsha3"],"ptokens":["code","debian","extended","fedora","fedoraproject","keccak","linux","package","php","project","pypy","pysha3","python","sha3"],"labels":["critical","cwe190","package","pypi","pysha3","python","ruby","rubygems","sha3","vendor"],"campaign_type":null,"search_a":"'-2022':8A,16A '-37454':9A,17A '2658':14A '2xhg':13A '6w4m':12A 'buffer':1A 'code':22A,27A 'cve':7A,15A 'debian':29A,31A 'extended':20A,25A 'fedora':34A,36A 'fedoraproject':33A,35A 'function':6A 'ghsa':11A 'ghsa-6w4m-2xhg':10A 'keccak':21A,26A 'linux':30A,32A 'overflow':2A 'package':23A,28A 'php':37A,38A,39A 'project':24A,45A,48A 'pypy':50A 'pysha3':18A,47A,49A 'python':40A,41A,42A,43A 'queue':5A 'sha3':19A,44A,46A 'spong':4A","search_b":"'-190':52B '2':81B '200':83B '32':82B 'abl':97B 'attack':90B 'buffer':75B 'byte':84B 'code':71B,103B 'control':92B 'corrupt':99B 'cwe':51B 'gem':61B 'input':78B,94B 'keccak':69B 'may':95B 'memori':100B 'overflow':73B 'packag':53B,65B 'partial':77B 'pysha3':54B,63B 'python':55B,64B 'queu':88B 'rubi':56B,60B 'run':102B 'sha3':57B,59B 'spong':70B 'wrap':67B","search_c":"'/xkcp/xkcp/commit/fdc6fef075f4e81d6b1bc38364248975e08e340a).':158C '/xkcp/xkcp/issues/105)':226C '105':223C '2':145C,179C '200':147C,181C '32':146C,180C 'absorb':115C 'accept':110C 'altern':201C 'altogeth':219C 'avoid':164C,215C 'buffer':123C 'byte':148C,182C 'call':184C 'chain':191C 'commit':154C 'data':128C,173C 'detail':229C 'digest':177C 'entir':206C,211C 'fdc6fef0':155C 'function':108C,200C,218C 'github.com':157C,225C 'github.com/xkcp/xkcp/commit/fdc6fef075f4e81d6b1bc38364248975e08e340a).':156C 'github.com/xkcp/xkcp/issues/105)':224C 'higher':194C 'impact':104C 'input':112C,172C,207C 'interfac':109C 'issu':222C 'keccak':106C 'least':137C 'length':143C 'level':195C 'limit':166C 'multipl':183C 'one':138C,202C 'origin':199C 'output':118C,176C,212C 'overflow':125C 'partial':111C,117C,127C,171C,175C 'patch':151C 'problem':161C 'process':204C 'produc':209C 'queu':134C,217C 'queue':187C 'refer':220C 'retain':197C 'see':153C,221C 'size':132C,168C 'specif':131C 'spong':107C 'squeez':121C 'system':188C 'workaround':159C 'yes':152C","cause_entry":null,"cause_path":null,"disclosures_checked_at":null,"first_public_at":"2022-10-20T12:42:45+00:00","kev":null,"cvss_vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","cvss_by":"GitHub","poc_count":1,"sources":[{"source":"ghsa","external_id":"GHSA-6w4m-2xhg-2658","url":"https://github.com/advisories/GHSA-6w4m-2xhg-2658","severity":"critical","published_at":"2023-04-26T17:39:58+00:00","modified_at":"2026-11-16T16:06:47+00:00","first_seen_at":"2026-11-16T16:08:25+00:00","fetched_at":"2026-11-16T16:17:15+00:00","note":null},{"source":"nvd","external_id":"CVE-2022-37454","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-37454","severity":null,"published_at":"2022-10-21T06:15:09+00:00","modified_at":"2026-10-14T18:17:03+00:00","first_seen_at":"2026-11-16T16:38:06+00:00","fetched_at":"2026-11-16T16:38:06+00:00","note":null}],"documents":[{"id":171032,"url":"https://api.github.com/repos/XKCP/XKCP/security-advisories/GHSA-6w4m-2xhg-2658","title":"Maintainer's advisory: api.github.com","kind":"vendor","source":"ghsa","publisher":"vendor","text":null,"published_at":null,"relation":"advisory","confidence":null,"note":"Maintainer's advisory: api.github.com"},{"id":171343,"url":"https://csrc.nist.gov/projects/hash-functions/sha-3-project","title":"Third-party advisory: csrc.nist.gov","kind":"advisory","source":"nvd","publisher":"research","text":null,"published_at":null,"relation":"advisory","confidence":null,"note":"Third-party advisory: csrc.nist.gov"},{"id":171344,"url":"https://github.com/XKCP/XKCP/security/advisories/GHSA-6w4m-2xhg-2658","title":"Patch: github.com","kind":"other","source":"nvd","publisher":"vendor","text":null,"published_at":"2022-10-20T12:42:45+00:00","relation":"fix","confidence":null,"note":"Patch: github.com"},{"id":171345,"url":"https://lists.debian.org/debian-lts-announce/2022/10/msg00041.html","title":"Third-party advisory: lists.debian.org","kind":"advisory","source":"nvd","publisher":"research","text":null,"published_at":null,"relation":"advisory","confidence":null,"note":"Third-party advisory: lists.debian.org"},{"id":171346,"url":"https://lists.debian.org/debian-lts-announce/2022/11/msg00000.html","title":"Third-party advisory: lists.debian.org","kind":"advisory","source":"nvd","publisher":"research","text":null,"published_at":null,"relation":"advisory","confidence":null,"note":"Third-party advisory: lists.debian.org"},{"id":171347,"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/3ALQ6BDDPX5HU5YBQOBMDVAA2TSGDKIJ/","title":"Third-party advisory: lists.fedoraproject.org","kind":"advisory","source":"nvd","publisher":"research","text":null,"published_at":null,"relation":"advisory","confidence":null,"note":"Third-party advisory: lists.fedoraproject.org"},{"id":171348,"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/CMIEXLMTW5GO36HTFFWIPB3OHZXCT3G4/","title":"Third-party advisory: lists.fedoraproject.org","kind":"advisory","source":"nvd","publisher":"research","text":null,"published_at":null,"relation":"advisory","confidence":null,"note":"Third-party advisory: lists.fedoraproject.org"},{"id":171349,"url":"https://mouha.be/sha-3-buffer-overflow/","title":"Exploit: mouha.be","kind":"poc","source":"nvd","publisher":"research","text":null,"published_at":null,"relation":"poc","confidence":null,"note":"Exploit: mouha.be"},{"id":171350,"url":"https://news.ycombinator.com/item?id=33281106","title":"Third-party advisory: news.ycombinator.com","kind":"advisory","source":"nvd","publisher":"research","text":null,"published_at":null,"relation":"advisory","confidence":null,"note":"Third-party advisory: news.ycombinator.com"},{"id":171351,"url":"https://www.debian.org/security/2022/dsa-5267","title":"Third-party advisory: www.debian.org","kind":"advisory","source":"nvd","publisher":"research","text":null,"published_at":null,"relation":"advisory","confidence":null,"note":"Third-party advisory: www.debian.org"},{"id":171352,"url":"https://www.debian.org/security/2022/dsa-5269","title":"Third-party advisory: www.debian.org","kind":"advisory","source":"nvd","publisher":"research","text":null,"published_at":null,"relation":"advisory","confidence":null,"note":"Third-party advisory: www.debian.org"}],"disclosures":[],"exploit_sources":[{"type":"poc","url":"https://mouha.be/sha-3-buffer-overflow/"},{"type":"epss","score":0.07413,"url":"https://api.first.org/data/v1/epss?cve=CVE-2022-37454"}],"notice":"Free to read, with fair use of about 60 pages a minute. For higher limits or API access: sales@infrastack.ai"}