CVE-2023-3635: Okio Signed to Unsigned Conversion Error vulnerability
5.9
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.47919%
CWE
Published
7/12/2023
Updated
11/27/2023
KEV Status
No
Technology
Java
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H
| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| com.squareup.okio:okio | maven | >= 2.0.0-RC1, < 3.4.0 | 3.4.0 |
| com.squareup.okio:okio | maven | < 1.17.6 | 1.17.6 |
| com.squareup.okio:okio-jvm | maven | >= 2.0.0-RC1, < 3.4.0 | 3.4.0 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability lies in the misinterpretation of the 'xlen' field in the GZIP header, treating it as signed instead of unsigned. This leads to an exception when xlen is large (e.g. >= 0x8000), which GzipSource fails to handle, resulting in a Denial of Service.
Two commits were analyzed:
- Commit
b4fa875dc24950680c386e4b1c593660ce4f7839(Java version): The patch clearly modifies theconsumeHeader()method withinokio.GzipSourceto correctly interpretxlenas an unsigned value (& 0xffff). This method directly contains the vulnerable logic. - Commit
81bce1a30af244550b0324597720e4799281da7b(Kotlin version): The patch modifies header processing logic within theokio.GzipSourceclass to correctly interpretxlenby converting to Int, masking with0xffff, and then converting to Long. While the specific private method name for header parsing isn't shown in the diff, this logic is invoked during the execution of the publicread()method. Theread()method is the entry point for processing the GZIP stream and is where the unhandled exception would ultimately manifest from, due to the faultyxleninterpretation in the code it calls.
Both identified functions are directly involved in the vulnerable processing of the xlen field. The Java version explicitly names consumeHeader. For the Kotlin version, read is the public API that orchestrates the vulnerable header parsing logic shown in the patch.