ruby: Buffer under-read in String#unpack
Published Apr 3, 2018
7.5
HIGHCVSS 3.0
EPSS 7.53%
Description
In Ruby before 2.2.10, 2.3.x before 2.3.7, 2.4.x before 2.4.4, 2.5.x before 2.5.1, and 2.6.0-preview1, an attacker controlling the unpacking format (similar to format string vulnerabilities) can trigger a buffer under-read in the String#unpack method, resulting in a massive and controlled information disclosure.
Affected products
No data.
Configuration 1
Configuration 2
- 14.04
- 16.04
- 17.10
Configuration 3
- 7.0
- 8.0
- 9.0
Configuration 4
- 6.0
- 7.0
- 7.4
- 7.5
- 7.6
No data.
Red Hat Enterprise Linux 7
ruby-0:2.0.0.648-36.el7
Fixed · RHSA-2019:2028
Red Hat Enterprise Linux 7.4 Advanced Update Support
ruby-0:2.0.0.648-36.el7_4
Fixed · RHSA-2020:2212
Red Hat Enterprise Linux 7.4 Telco Extended Update Support
ruby-0:2.0.0.648-36.el7_4
Fixed · RHSA-2020:2212
Red Hat Enterprise Linux 7.4 Update Services for SAP Solutions
ruby-0:2.0.0.648-36.el7_4
Fixed · RHSA-2020:2212
Red Hat Enterprise Linux 7.5 Extended Update Support
ruby-0:2.0.0.648-36.el7_5
Fixed · RHSA-2020:1963
Red Hat Enterprise Linux 7.6 Extended Update Support
ruby-0:2.0.0.648-37.el7_6
Fixed · RHSA-2020:2288
Red Hat Software Collections for Red Hat Enterprise Linux 6
rh-ruby23-ruby-0:2.3.8-69.el6
Fixed · RHSA-2018:3729
Red Hat Software Collections for Red Hat Enterprise Linux 6
rh-ruby24-ruby-0:2.4.5-91.el6
Fixed · RHSA-2018:3730
Red Hat Software Collections for Red Hat Enterprise Linux 7
rh-ruby23-ruby-0:2.3.8-69.el7
Fixed · RHSA-2018:3729
Red Hat Software Collections for Red Hat Enterprise Linux 7
rh-ruby24-ruby-0:2.4.5-91.el7
Fixed · RHSA-2018:3730
Red Hat Software Collections for Red Hat Enterprise Linux 7
rh-ruby25-ruby-0:2.5.3-6.el7
Fixed · RHSA-2018:3731
Red Hat Software Collections for Red Hat Enterprise Linux 7.4 EUS
rh-ruby23-ruby-0:2.3.8-69.el7
Fixed · RHSA-2018:3729
Red Hat Software Collections for Red Hat Enterprise Linux 7.4 EUS
rh-ruby24-ruby-0:2.4.5-91.el7
Fixed · RHSA-2018:3730
Red Hat Software Collections for Red Hat Enterprise Linux 7.4 EUS
rh-ruby25-ruby-0:2.5.3-6.el7
Fixed · RHSA-2018:3731
Red Hat Software Collections for Red Hat Enterprise Linux 7.5 EUS
rh-ruby23-ruby-0:2.3.8-69.el7
Fixed · RHSA-2018:3729
Red Hat Software Collections for Red Hat Enterprise Linux 7.5 EUS
rh-ruby24-ruby-0:2.4.5-91.el7
Fixed · RHSA-2018:3730
Red Hat Software Collections for Red Hat Enterprise Linux 7.5 EUS
rh-ruby25-ruby-0:2.5.3-6.el7
Fixed · RHSA-2018:3731
Red Hat Software Collections for Red Hat Enterprise Linux 7.6 EUS
rh-ruby23-ruby-0:2.3.8-69.el7
Fixed · RHSA-2018:3729
Red Hat Software Collections for Red Hat Enterprise Linux 7.6 EUS
rh-ruby24-ruby-0:2.4.5-91.el7
Fixed · RHSA-2018:3730
Red Hat Software Collections for Red Hat Enterprise Linux 7.6 EUS
rh-ruby25-ruby-0:2.5.3-6.el7
Fixed · RHSA-2018:3731
Red Hat Enterprise Linux 5
ruby
Will not fix
Red Hat Enterprise Linux 6
ruby
Will not fix
Red Hat Enterprise Linux 8
ruby
Not affected
Red Hat Software Collections
rh-ruby22-ruby
Will not fix
Red Hat Subscription Asset Manager
ruby193-ruby
Will not fix
| Product | Package | State | Advisory |
|---|---|---|---|
| Red Hat Enterprise Linux 7 | ruby-0:2.0.0.648-36.el7 | Fixed | RHSA-2019:2028 |
| Red Hat Enterprise Linux 7.4 Advanced Update Support | ruby-0:2.0.0.648-36.el7_4 | Fixed | RHSA-2020:2212 |
| Red Hat Enterprise Linux 7.4 Telco Extended Update Support | ruby-0:2.0.0.648-36.el7_4 | Fixed | RHSA-2020:2212 |
| Red Hat Enterprise Linux 7.4 Update Services for SAP Solutions | ruby-0:2.0.0.648-36.el7_4 | Fixed | RHSA-2020:2212 |
| Red Hat Enterprise Linux 7.5 Extended Update Support | ruby-0:2.0.0.648-36.el7_5 | Fixed | RHSA-2020:1963 |
| Red Hat Enterprise Linux 7.6 Extended Update Support | ruby-0:2.0.0.648-37.el7_6 | Fixed | RHSA-2020:2288 |
| Red Hat Software Collections for Red Hat Enterprise Linux 6 | rh-ruby23-ruby-0:2.3.8-69.el6 | Fixed | RHSA-2018:3729 |
| Red Hat Software Collections for Red Hat Enterprise Linux 6 | rh-ruby24-ruby-0:2.4.5-91.el6 | Fixed | RHSA-2018:3730 |
| Red Hat Software Collections for Red Hat Enterprise Linux 7 | rh-ruby23-ruby-0:2.3.8-69.el7 | Fixed | RHSA-2018:3729 |
| Red Hat Software Collections for Red Hat Enterprise Linux 7 | rh-ruby24-ruby-0:2.4.5-91.el7 | Fixed | RHSA-2018:3730 |
| Red Hat Software Collections for Red Hat Enterprise Linux 7 | rh-ruby25-ruby-0:2.5.3-6.el7 | Fixed | RHSA-2018:3731 |
| Red Hat Software Collections for Red Hat Enterprise Linux 7.4 EUS | rh-ruby23-ruby-0:2.3.8-69.el7 | Fixed | RHSA-2018:3729 |
| Red Hat Software Collections for Red Hat Enterprise Linux 7.4 EUS | rh-ruby24-ruby-0:2.4.5-91.el7 | Fixed | RHSA-2018:3730 |
| Red Hat Software Collections for Red Hat Enterprise Linux 7.4 EUS | rh-ruby25-ruby-0:2.5.3-6.el7 | Fixed | RHSA-2018:3731 |
| Red Hat Software Collections for Red Hat Enterprise Linux 7.5 EUS | rh-ruby23-ruby-0:2.3.8-69.el7 | Fixed | RHSA-2018:3729 |
| Red Hat Software Collections for Red Hat Enterprise Linux 7.5 EUS | rh-ruby24-ruby-0:2.4.5-91.el7 | Fixed | RHSA-2018:3730 |
| Red Hat Software Collections for Red Hat Enterprise Linux 7.5 EUS | rh-ruby25-ruby-0:2.5.3-6.el7 | Fixed | RHSA-2018:3731 |
| Red Hat Software Collections for Red Hat Enterprise Linux 7.6 EUS | rh-ruby23-ruby-0:2.3.8-69.el7 | Fixed | RHSA-2018:3729 |
| Red Hat Software Collections for Red Hat Enterprise Linux 7.6 EUS | rh-ruby24-ruby-0:2.4.5-91.el7 | Fixed | RHSA-2018:3730 |
| Red Hat Software Collections for Red Hat Enterprise Linux 7.6 EUS | rh-ruby25-ruby-0:2.5.3-6.el7 | Fixed | RHSA-2018:3731 |
| Red Hat Enterprise Linux 5 | ruby | Will not fix | n/a |
| Red Hat Enterprise Linux 6 | ruby | Will not fix | n/a |
| Red Hat Enterprise Linux 8 | ruby | Not affected | n/a |
| Red Hat Software Collections | rh-ruby22-ruby | Will not fix | n/a |
| Red Hat Subscription Asset Manager | ruby193-ruby | Will not fix | n/a |
No package ranges for this CVE.
Remediation
Red Hat statement
This issue affects the versions of ruby as shipped with Red Hat CloudForms 4. Red Hat Product Security has rated this issue as having security impact of Moderate. A future update may address this issue. For additional information, refer to the Issue Severity Classification: https://access.redhat.com/security/updates/classification/. This issue affects the versions of ruby as shipped with Red Hat Subscription Asset Manager 1. Red Hat Product Security has rated this issue as having security impact of Moderate. A future update may address this issue. For additional information, refer to the Issue Severity Classification: https://access.redhat.com/security/updates/classification/.
Red Hat mitigation
Vulnerable code when String#unpack's argument is attacker controlled. In the unpack format string argemument, manual sanitization can be done by preventing the number following '@' to overflow to a negative number. See https://dev.to/sqreenio/an-in-depth-look-at-cve-2018-8878-or-why-integer-overflows-are-still-a-thing-1n01 for mitigation details.
Metrics
No CVSS v4.0 score for this CVE.
No CVSS v3.1 score for this CVE.
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
1 other source (Red Hat) ▾
CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:L
AV:N/AC:L/Au:N/C:P/I:N/A:N
This CVE is not in the KEV list.
No CISA SSVC assessment for this CVE yet.
Estimated probability of exploitation in the wild in the next 30 days (FIRST EPSS). As of Oct 3, 2026.
Score over time
2021–2026- EPSS v1
- EPSS v2
- EPSS v3
- EPSS v4
- EPSS v5
Percentile over time
- EPSS v1
- EPSS v2
- EPSS v3
- EPSS v4
- EPSS v5
Table of values (27 key points)
Flat stretches are collapsed; showing up to 120 newest points.
| Date | Score | Percentile | Model |
|---|---|---|---|
| Oct 3, 2026 | 7.53% (0.07529) | 94.33th | v5 (v2026.06.15) |
| Jun 15, 2026 | 7.83% (0.07825) | 93.89th | v5 (v2026.06.15) |
| Jun 4, 2025 | 0.69% (0.00691) | 70.71th | v4 (v2025.03.14) |
| Jun 1, 2025 | 1.84% (0.01838) | 82.11th | v4 (v2025.03.14) |
| Mar 30, 2025 | 0.69% (0.00691) | 69.48th | v4 (v2025.03.14) |
| Mar 29, 2025 | 7.73% (0.07730) | 86.26th | v4 (v2025.03.14) |
| Mar 22, 2025 | 0.69% (0.00691) | 69.59th | v4 (v2025.03.14) |
| Mar 21, 2025 | 1.84% (0.01838) | 81.44th | v4 (v2025.03.14) |
| Mar 17, 2025 | 0.69% (0.00691) | 70.13th | v4 (v2025.03.14) |
| Dec 12, 2024 | 0.42% (0.00424) | 75.12th | v3 (v2023.03.01) |
| Jul 7, 2024 | 0.42% (0.00424) | 74.44th | v3 (v2023.03.01) |
| May 29, 2024 | 0.42% (0.00418) | 74.07th | v3 (v2023.03.01) |
| Apr 18, 2024 | 0.45% (0.00451) | 74.85th | v3 (v2023.03.01) |
| Mar 13, 2024 | 0.64% (0.00639) | 78.69th | v3 (v2023.03.01) |
| Jan 17, 2024 | 0.74% (0.00738) | 78.80th | v3 (v2023.03.01) |
| Nov 21, 2023 | 0.60% (0.00599) | 76.03th | v3 (v2023.03.01) |
| Oct 4, 2023 | 0.55% (0.00552) | 74.83th | v3 (v2023.03.01) |
| Aug 25, 2023 | 0.65% (0.00649) | 76.74th | v3 (v2023.03.01) |
| Mar 28, 2023 | 0.51% (0.00510) | 73.00th | v3 (v2023.03.01) |
| Mar 7, 2023 | 0.45% (0.00453) | 71.28th | v3 (v2023.03.01) |
| Mar 6, 2023 | 2.69% (0.02686) | 82.85th | v2 (v2022.01.01) |
| Apr 1, 2022 | 2.69% (0.02686) | 81.17th | v2 (v2022.01.01) |
| Feb 4, 2022 | 2.69% (0.02686) | 62.66th | v2 (v2022.01.01) |
| Feb 3, 2022 | 3.68% (0.03679) | 72.20th | v1 |
| Jan 6, 2022 | 3.68% (0.03679) | 71.95th | v1 |
| Sep 1, 2021 | 3.68% (0.03679) | 82.80th | v1 |
| Apr 14, 2021 | 3.68% (0.03679) | 0.00th | v1 |
References (21)
- http://lists.opensuse.org/opensuse-security-announce/2019-07/msg00036.html vendor-advisoryx_refsource_SUSE
- http://www.securityfocus.com/bid/103693 vdb-entryx_refsource_BIDThird Party AdvisoryVDB Entry
- http://www.securitytracker.com/id/1042004 vdb-entryx_refsource_SECTRACKThird Party AdvisoryVDB Entry
- https://access.redhat.com/errata/RHSA-2018:3729 vendor-advisoryx_refsource_REDHATThird Party Advisory
- https://access.redhat.com/errata/RHSA-2018:3730 vendor-advisoryx_refsource_REDHATThird Party Advisory
- https://access.redhat.com/errata/RHSA-2018:3731 vendor-advisoryx_refsource_REDHATThird Party Advisory
- https://access.redhat.com/errata/RHSA-2019:2028 vendor-advisoryx_refsource_REDHAT
- https://access.redhat.com/security/cve/CVE-2018-8778 Vendor Advisory
- https://bugzilla.redhat.com/show_bug.cgi?id=1561953 Issue Tracking
- https://lists.debian.org/debian-lts-announce/2018/04/msg00023.html mailing-listx_refsource_MLISTMailing ListThird Party Advisory
- https://lists.debian.org/debian-lts-announce/2018/04/msg00024.html mailing-listx_refsource_MLISTMailing ListThird Party Advisory
- https://lists.debian.org/debian-lts-announce/2018/07/msg00012.html mailing-listx_refsource_MLISTMailing ListThird Party Advisory
- https://nvd.nist.gov/vuln/detail/CVE-2018-8778
- https://usn.ubuntu.com/3626-1/ vendor-advisoryx_refsource_UBUNTUThird Party Advisory
- https://www.cve.org/CVERecord?id=CVE-2018-8778
- https://www.debian.org/security/2018/dsa-4259 vendor-advisoryx_refsource_DEBIANThird Party Advisory
- https://www.ruby-lang.org/en/news/2018/03/28/buffer-under-read-unpack-cve-2018-8778/ x_refsource_CONFIRMVendor Advisory
- https://www.ruby-lang.org/en/news/2018/03/28/ruby-2-2-10-released/ x_refsource_CONFIRMPatchVendor Advisory
- https://www.ruby-lang.org/en/news/2018/03/28/ruby-2-3-7-released/ x_refsource_CONFIRMPatchVendor Advisory
- https://www.ruby-lang.org/en/news/2018/03/28/ruby-2-4-4-released/ x_refsource_CONFIRMPatchVendor Advisory
- https://www.ruby-lang.org/en/news/2018/03/28/ruby-2-5-1-released/ x_refsource_CONFIRMPatchVendor Advisory
Change history (0)
No recorded changes yet.