Miggo Logo

CVE-2023-34454: snappy-java's Integer Overflow vulnerability in compress leads to DoS

5.9

CVSS Score
3.1

Basic Information

EPSS Score
0.42644%
Published
6/15/2023
Updated
11/8/2023
KEV Status
No
Technology
TechnologyJava

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
org.xerial.snappy:snappy-javamaven<= 1.1.10.01.1.10.1

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability lies in the integer overflow that can occur when calculating the byteSize in various overloaded compress methods within Snappy.java. This happens because input.length is multiplied by a factor (2, 4, or 8 depending on the data type) without checking for potential overflow before passing this byteSize to the rawCompress method. The rawCompress method then uses this byteSize to determine the size of an intermediate buffer. If the byteSize is negative due to overflow, a NegativeArraySizeException is thrown when allocating the buffer. If the byteSize overflows to a small positive value, the buffer allocated might be too small for the actual data, leading to a native crash (Access Violation) when impl.rawCompress is called. The provided patch addresses this by adding a check in each compress method to ensure byteSize is not smaller than input.length (which would indicate an overflow) before calling rawCompress. Therefore, all the overloaded compress methods are directly vulnerable as they perform the faulty calculation, and rawCompress is vulnerable as it consumes this faulty value leading to exceptions or crashes.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

## Summ*ry *u* to un****k** multipli**tions, *n int***r ov*r*low m*y o**ur, **usin* *n unr**ov*r**l* **t*l *rror. ## Imp**t **ni*l o* S*rvi** ## **s*ription T** *un*tion [*ompr*ss(***r[] input)](*ttps://*it*u*.*om/x*ri*l/sn*ppy-j*v*/*lo*/************

Reasoning

T** vuln*r**ility li*s in t** int***r ov*r*low t**t **n o**ur w**n **l*ul*tin* t** `*yt*Siz*` in v*rious ov*rlo**** `*ompr*ss` m*t*o*s wit*in `Sn*ppy.j*v*`. T*is **pp*ns ****us* `input.l*n*t*` is multipli** *y * ***tor (*, *, or * **p*n*in* on t** **