CVE-2024-27280: StringIO buffer overread vulnerability
9.8
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.84064%
CWE
Published
3/25/2024
Updated
8/7/2024
KEV Status
No
Technology
Ruby
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| stringio | rubygems | < 3.0.1.1 | 3.0.1.1 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from the buffer management in ungetbyte/ungetc operations. The commit c58c5f5 shows a critical fix in strio_unget_bytes where buffer expansion calculations were incorrect (ex = cl - (rest < 0 ? pos : len) vs original flawed logic). This miscalculation allowed writing beyond the buffer's allocated space. Subsequent gets calls would then read from this corrupted buffer state, exposing memory. The test cases added for ungetc_fill/ungetbyte_fill validate this by testing large unget operations that would trigger buffer expansion.