Miggo Logo

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

9.8

CVSS Score

Basic Information

EPSS Score
-
Published
4/26/2023
Updated
5/3/2023
KEV Status
No
Technology
TechnologyPython

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
pysha3pip<= 1.0.2
sha3rubygems< 1.0.51.0.5

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from improper handling of large partial blocks in the sponge functions. The commit fdc6fef0 shows critical fixes in both SpongeAbsorb and SpongeSqueeze where: 1) Partial block size calculations were changed from 'partialBlock = (unsigned int)(dataByteLen - i)' to overflow-safe comparisons, 2) Buffer management logic was modified to prevent integer wrap-around. The GitHub issue #105 explicitly identifies these functions as containing the vulnerable comparison patterns. Multiple implementations (Python's hashlib, PHP's hash_init) using this XKCP code exhibited the crash behavior described, confirming the functions' roles.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

### Imp**t T** K****k spon** *un*tion int*r**** ****pts p*rti*l inputs to ** **sor*** *n* p*rti*l outputs to ** squ**z**. * *u***r **n ov*r*low w**n p*rti*l **t* wit* som* sp**i*i* siz*s *r* qu*u**, w**r* *t l**st on* o* t**m **s * l*n*t* o* *^** -

Reasoning

T** vuln*r**ility st*ms *rom improp*r **n*lin* o* l*r** p*rti*l *lo*ks in t** spon** *un*tions. T** *ommit ******** s*ows *riti**l *ix*s in *ot* Spon****sor* *n* Spon**Squ**z* w**r*: *) P*rti*l *lo*k siz* **l*ul*tions w*r* ***n*** *rom 'p*rti*l*lo*k