Track vulnerabilities like this one.
Sign up free to get alerted when software you use is affected.
9.3
CVE-2024-27280: Ruby StringIO may reveal memory data
CVE-2024-27280 · published 2 years ago
Summary
The StringIO library used in Ruby 3.0 and 3.1 can read past the end of a string, potentially exposing the contents of memory to the program. This can happen when the ungetbyte or ungetc functions are used and then StringIO.gets is called. Upgrade to the patched StringIO version (3.0.3 or the specific 3.0.1.1/3.0.1.2 releases) to eliminate the risk.
What to do
- Update nobu nakada stringio to version 3.0.1.1.
- Update stringio to version 0.1.0.41610.1.
- Update debian ruby3.1 to version 3.1.2-7+deb12u1.
- Update ruby to version 3.1.5-r0.
- Update ruby to version 3.2.4-r0.
- Update ruby to version 3.3.1-r0.
- Update canonical ruby2.5 to version 2.5.1-1ubuntu1.16+esm5.
- Update canonical ruby2.7 to version 2.7.0-5ubuntu1.14.
- Update canonical ruby3.0 to version 3.0.2-7ubuntu2.7.
Affected software
| Ecosystem | Vendor | Product | Affected versions |
|---|---|---|---|
| rubygems | nobu nakada | stringio |
< 3.0.1.1 Fix: upgrade to 3.0.1.1
|
| Root:Ruby | – | stringio |
< 0.1.0.41610.1 Fix: upgrade to 0.1.0.41610.1
|
| Debian:12 | debian | ruby3.1 |
< 3.1.2-7+deb12u1 Fix: upgrade to 3.1.2-7+deb12u1
|
| Alpine:v3.16 | – | ruby |
< 3.1.5-r0 Fix: upgrade to 3.1.5-r0
|
| Alpine:v3.18 | – | ruby |
< 3.2.4-r0 Fix: upgrade to 3.2.4-r0
|
| Alpine:v3.20 | – | ruby |
< 3.3.1-r0 Fix: upgrade to 3.3.1-r0
|
| Ubuntu:Pro:16.04:LTS | canonical | ruby2.3 | All versions |
| Ubuntu:Pro:18.04:LTS | canonical | ruby2.5 |
< 2.5.1-1ubuntu1.16+esm5 Fix: upgrade to 2.5.1-1ubuntu1.16+esm5
|
| Ubuntu:20.04:LTS | canonical | ruby2.7 |
< 2.7.0-5ubuntu1.14 Fix: upgrade to 2.7.0-5ubuntu1.14
|
| Ubuntu:22.04:LTS | canonical | ruby3.0 |
< 3.0.2-7ubuntu2.7 Fix: upgrade to 3.0.2-7ubuntu2.7
|
Original advisory text
CVE-2024-27280 in stringio - Patched by Root
A buffer-overread issue was discovered in StringIO 3.0.1, as distributed in Ruby 3.0.x through 3.0.6 and 3.1.x through 3.1.4. The ungetbyte and ungetc methods on a StringIO can read past the end of a string, and a subsequent call to StringIO.gets may return the memory value. 3.0.3 is the main fixed version; however, for Ruby 3.0 users, a fixed version is stringio 3.0.1.1, and for Ruby 3.1 users, a fixed version is stringio 3.0.1.2.
References
- https://github.com/ruby/stringio/commit/0e596524097706263d10900ca180898e4a8f5233
- https://github.com/ruby/stringio/commit/c58c5f54f1eab99665ea6a161d29ff6a7490afc8
- https://github.com/rubysec/ruby-advisory-db/blob/master/gems/stringio/CVE-2024-2...
- https://www.ruby-lang.org/en/news/2024/03/21/buffer-overread-cve-2024-27280
- https://nvd.nist.gov/vuln/detail/CVE-2024-27280
- https://hackerone.com/reports/1399856
- https://security.netapp.com/advisory/ntap-20250502-0003
- https://lists.debian.org/debian-lts-announce/2024/09/msg00000.html
- https://lists.fedoraproject.org/archives/list/[email protected]...
- https://lists.fedoraproject.org/archives/list/[email protected]...
- http://seclists.org/fulldisclosure/2025/Sep/53
- http://seclists.org/fulldisclosure/2025/Sep/54
- http://seclists.org/fulldisclosure/2025/Sep/55
- https://github.com/advisories/GHSA-v5h6-c2hv-hv3r
- https://lists.fedoraproject.org/archives/list/[email protected]...
- https://lists.fedoraproject.org/archives/list/[email protected]...
- https://security.netapp.com/advisory/ntap-20250502-0003/
- https://security-tracker.debian.org/tracker/CVE-2024-27280 Vendor Advisory
- https://ubuntu.com/security/CVE-2024-27280 Third Party Advisory
- https://www.ruby-lang.org/en/news/2024/03/21/buffer-overread-cve-2024-27280/ Third Party Advisory
- https://www.cve.org/CVERecord?id=CVE-2024-27280 Third Party Advisory
- https://ubuntu.com/security/notices/USN-6853-1 Vendor Advisory
- https://ubuntu.com/security/notices/USN-7734-1 Vendor Advisory
- https://security.alpinelinux.org/vuln/CVE-2024-27280 Vendor Advisory
Internet-facing
3 days
Internal
60 days
- Not known to be exploited
- Can be exploited automatically
- Gives an attacker full control
Type
CWE-120Classic Buffer Overflow
CWE-126Buffer Over-read
Timeline
Published14 May 2024
Updated5 Dec 2026
First seen6 Mar 2026
Sources
GHSA-v5h6-c2hv-hv3r · GHSA
CVE-2024-27280 · NVD
DEBIAN-CVE-2024-27280 · OSV
UBUNTU-CVE-2024-27280 · OSV
ALPINE-CVE-2024-27280 · OSV
Track software like this
Free during beta