CVE-2024-27280: Stringio StringIO Buffer Overread Vulnerability Vulnerability

CRITICAL
Advisory Identifier: GHSA-v5h6-c2hv-hv3r
CVSS 9.8
CWE-120 CWE-126
Published
Advisory Summary

CVE-2024-27280 is a CRITICAL (CVSS 9.8) stringio buffer overread vulnerability vulnerability (CWE-120: Buffer Copy without Checking Size of Input ('Classic Buffer Overflow')) affecting Stringio libraries in the RubyGems ecosystem. The issue involves stringio buffer overread vulnerability. Remediation is available by upgrading affected packages to version 3.0.1.1.

CVE-2024-27280 at a Glance

CVE Identifier CVE-2024-27280
GHSA Identifier GHSA-v5h6-c2hv-hv3r
Severity CRITICAL
CVSS v3.1 Base Score 9.8
CWE Classification CWE-120: Buffer Copy without Checking Size of Input ('Classic Buffer Overflow')
Affected Product Stringio
Package Ecosystem RubyGems
Published Date
Last Updated

Security Impact

CVSS: 9.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2024-27280

To remediate this vulnerability, upgrade all affected Stringio dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

stringio fixed: 3.0.1.1
Upgrade stringio to 3.0.1.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for stringio

How to Check if You Are Affected

To determine whether your application is affected by CVE-2024-27280, inspect your project dependencies for Stringio:

inspect dependencies for stringio

Analyze the terminal output to locate any version of Stringio in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.0.1.1), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-120: Buffer Copy without Checking Size of Input ('Classic Buffer Overflow'), where the product copies an input buffer to an output buffer without verifying that the size of the input buffer is less than the size of the output buffer. In Stringio, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

An 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. This vulnerability is not affected StringIO 3.0.3 and later, and Ruby 3.2.x and later. We recommend to update the StringIO gem to version 3.0.3 or later. In order to ensure compatibility with bundled version in older Ruby series, you may update as follows instead: * For Ruby 3.0 users: Update to `stringio` 3.0.1.1 * For Ruby 3.1 users: Update to `stringio` 3.1.0.2 You can use `gem update stringio` to update it. If you are using bundler, please add `gem "stringio", ">= 3.0.1.2"` to your `Gemfile`.

CVE-2024-27280 Affected Stringio Versions

1 component(s)
Fixed Versions:
3.0.1.1
Product / Package Ecosystem Affected Versions Fixed Version
stringio
RubyGems
< 3.0.1.1
3.0.1.1

References

NVD — CVE-2024-27280 NVD
https://nvd.nist.gov/vuln/detail/CVE-2024-27280
Security Fix Commit FIX COMMIT
https://github.com/ruby/stringio/commit/0e596524097706263d10900ca180898e4a8f5233
Security Fix Commit FIX COMMIT
https://github.com/ruby/stringio/commit/c58c5f54f1eab99665ea6a161d29ff6a7490afc8
hackerone.com/reports/1399856 WEB
https://hackerone.com/reports/1399856
Stringio Source Repository REPOSITORY
https://github.com/ruby/stringio
Stringio Source Repository REPOSITORY
https://github.com/rubysec/ruby-advisory-db/blob/master/gems/stringio/CVE-2024-27280.yml
lists.debian.org/debian-lts-announce... WEB
https://lists.debian.org/debian-lts-announce/2024/09/msg00000.html
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/27LUWREIFTP3MQAW7QE4PJM4DPAQJWXF
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/XYDHPHEZI7OQXTQKTDZHGZNPIJH7ZV5N
Stringio Security Information SECURITY
https://security.netapp.com/advisory/ntap-20250502-0003
www.ruby-lang.org/en/news/2024/03/21/... WEB
https://www.ruby-lang.org/en/news/2024/03/21/buffer-overread-cve-2024-27280
seclists.org/fulldisclosure/2025... WEB
http://seclists.org/fulldisclosure/2025/Sep/53
seclists.org/fulldisclosure/2025... WEB
http://seclists.org/fulldisclosure/2025/Sep/54
seclists.org/fulldisclosure/2025... WEB
http://seclists.org/fulldisclosure/2025/Sep/55

Frequently Asked Questions

What is CVE-2024-27280?
CVE-2024-27280 is a security vulnerability in Stringio involving StringIO buffer overread vulnerability under CWE-120: Buffer Copy without Checking Size of Input ('Classic Buffer Overflow').
Which Stringio versions are affected?
Affected versions include releases prior to 3.0.1.1 across affected packages: stringio.
What version fixes CVE-2024-27280?
Upgrading to 3.0.1.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is stringio affected?
Yes, stringio is affected in releases prior to 3.0.1.1. Upgrade your dependency to 3.0.1.1 or later.
What is the CVSS score of CVE-2024-27280?
CVE-2024-27280 has a CVSS v3.1 base score of 9.8 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2024-27280?
CVE-2024-27280 is classified under CWE-120: Buffer Copy without Checking Size of Input ('Classic Buffer Overflow') (The product copies an input buffer to an output buffer without verifying that the size of the input buffer is less than the size of the output buffer.).
How can I check RubyGems dependencies for CVE-2024-27280?
Run the dependency tree command: 'inspect dependencies for stringio'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-v5h6-c2hv-hv3r",
  "modified" : "2025-11-04T19:46:14Z",
  "published" : "2024-03-25T19:36:52Z",
  "aliases" : [ "CVE-2024-27280" ],
  "summary" : "StringIO buffer overread vulnerability",
  "details" : "An 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.\n\nThe `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.\n\nThis vulnerability is not affected StringIO 3.0.3 and later, and Ruby 3.2.x and later.\n\nWe recommend to update the StringIO gem to version 3.0.3 or later. In order to ensure compatibility with bundled version in older Ruby series, you may update as follows instead:\n\n* For Ruby 3.0 users: Update to `stringio` 3.0.1.1\n* For Ruby 3.1 users: Update to `stringio` 3.1.0.2\n\nYou can use `gem update stringio` to update it. If you are using bundler, please add `gem \"stringio\", \">= 3.0.1.2\"` to your `Gemfile`.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "stringio"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.0.1.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-27280"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ruby/stringio/commit/0e596524097706263d10900ca180898e4a8f5233"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ruby/stringio/commit/c58c5f54f1eab99665ea6a161d29ff6a7490afc8"
  }, {
    "type" : "WEB",
    "url" : "https://hackerone.com/reports/1399856"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/ruby/stringio"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/stringio/CVE-2024-27280.yml"
  }, {
    "type" : "WEB",
    "url" : "https://lists.debian.org/debian-lts-announce/2024/09/msg00000.html"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/27LUWREIFTP3MQAW7QE4PJM4DPAQJWXF"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/XYDHPHEZI7OQXTQKTDZHGZNPIJH7ZV5N"
  }, {
    "type" : "WEB",
    "url" : "https://security.netapp.com/advisory/ntap-20250502-0003"
  }, {
    "type" : "WEB",
    "url" : "https://www.ruby-lang.org/en/news/2024/03/21/buffer-overread-cve-2024-27280"
  }, {
    "type" : "WEB",
    "url" : "http://seclists.org/fulldisclosure/2025/Sep/53"
  }, {
    "type" : "WEB",
    "url" : "http://seclists.org/fulldisclosure/2025/Sep/54"
  }, {
    "type" : "WEB",
    "url" : "http://seclists.org/fulldisclosure/2025/Sep/55"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-120", "CWE-126" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-03-25T19:36:52Z",
    "nvd_published_at" : "2024-05-14T15:11:56Z"
  }
}