ruby: Unintentional directory traversal by poisoned NULL byte in Dir
Published Apr 3, 2018
9.1
CRITICALCVSS 3.0
EPSS 9.72%
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, the Dir.open, Dir.new, Dir.entries and Dir.empty? methods do not check NULL characters. When using the corresponding method, unintentional directory traversal may be performed.
Affected products
No data.
Configuration 1
Configuration 2
- 14.04
- 16.04
- 17.10
Configuration 3
- 7.0
- 8.0
- 9.0
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-35.el7_4
Fixed · RHSA-2020:0591
Red Hat Enterprise Linux 7.4 Telco Extended Update Support
ruby-0:2.0.0.648-35.el7_4
Fixed · RHSA-2020:0591
Red Hat Enterprise Linux 7.4 Update Services for SAP Solutions
ruby-0:2.0.0.648-35.el7_4
Fixed · RHSA-2020:0591
Red Hat Enterprise Linux 7.5 Extended Update Support
ruby-0:2.0.0.648-35.el7_5
Fixed · RHSA-2020:0542
Red Hat Enterprise Linux 7.6 Extended Update Support
ruby-0:2.0.0.648-36.el7_6
Fixed · RHSA-2020:0663
Red Hat Hardened Images
ruby3-3-main-3.3.10-23.1.hum1
Fixed · RHSA-2026:7305
Red Hat Hardened Images
ruby3-4-main-3.4.8-31.1.hum1
Fixed · RHSA-2026:7307
Red Hat Hardened Images
ruby4-0-main-4.0.0-33.3.hum1
Fixed · RHSA-2026:8838
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
CloudForms Management Engine 5
rh-ruby22-ruby
Affected
CloudForms Management Engine 5
ruby-200-ruby
Affected
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 Hardened Images
ruby
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-35.el7_4 | Fixed | RHSA-2020:0591 |
| Red Hat Enterprise Linux 7.4 Telco Extended Update Support | ruby-0:2.0.0.648-35.el7_4 | Fixed | RHSA-2020:0591 |
| Red Hat Enterprise Linux 7.4 Update Services for SAP Solutions | ruby-0:2.0.0.648-35.el7_4 | Fixed | RHSA-2020:0591 |
| Red Hat Enterprise Linux 7.5 Extended Update Support | ruby-0:2.0.0.648-35.el7_5 | Fixed | RHSA-2020:0542 |
| Red Hat Enterprise Linux 7.6 Extended Update Support | ruby-0:2.0.0.648-36.el7_6 | Fixed | RHSA-2020:0663 |
| Red Hat Hardened Images | ruby3-3-main-3.3.10-23.1.hum1 | Fixed | RHSA-2026:7305 |
| Red Hat Hardened Images | ruby3-4-main-3.4.8-31.1.hum1 | Fixed | RHSA-2026:7307 |
| Red Hat Hardened Images | ruby4-0-main-4.0.0-33.3.hum1 | Fixed | RHSA-2026:8838 |
| 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 |
| CloudForms Management Engine 5 | rh-ruby22-ruby | Affected | n/a |
| CloudForms Management Engine 5 | ruby-200-ruby | Affected | n/a |
| 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 Hardened Images | ruby | 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
It is possible to test for presence of the NULL byte manually prior to call a Dir method with an untrusted string.
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:H/A:N
1 other source (Red Hat) ▾
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N
AV:N/AC:L/Au:N/C:P/I:P/A:P
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 1, 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 (34 key points)
Flat stretches are collapsed; showing up to 120 newest points.
| Date | Score | Percentile | Model |
|---|---|---|---|
| Oct 1, 2026 | 9.72% (0.09718) | 95.38th | v5 (v2026.06.15) |
| Jun 15, 2026 | 10.10% (0.10098) | 95.03th | v5 (v2026.06.15) |
| Mar 4, 2026 | 1.34% (0.01344) | 79.77th | v4 (v2025.03.14) |
| Mar 1, 2026 | 2.98% (0.02981) | 86.34th | v4 (v2025.03.14) |
| Feb 4, 2026 | 1.34% (0.01344) | 79.69th | v4 (v2025.03.14) |
| Feb 1, 2026 | 2.98% (0.02981) | 86.23th | v4 (v2025.03.14) |
| Jan 4, 2026 | 1.25% (0.01246) | 78.83th | v4 (v2025.03.14) |
| Jan 1, 2026 | 2.77% (0.02768) | 85.66th | v4 (v2025.03.14) |
| Dec 4, 2025 | 1.25% (0.01246) | 78.68th | v4 (v2025.03.14) |
| Dec 1, 2025 | 2.77% (0.02768) | 85.60th | v4 (v2025.03.14) |
| Nov 4, 2025 | 1.25% (0.01246) | 78.64th | v4 (v2025.03.14) |
| Nov 1, 2025 | 2.77% (0.02768) | 85.56th | v4 (v2025.03.14) |
| Oct 4, 2025 | 1.31% (0.01312) | 79.13th | v4 (v2025.03.14) |
| Oct 1, 2025 | 2.91% (0.02912) | 85.90th | v4 (v2025.03.14) |
| Aug 5, 2025 | 1.38% (0.01383) | 79.51th | v4 (v2025.03.14) |
| Aug 1, 2025 | 2.66% (0.02658) | 85.28th | v4 (v2025.03.14) |
| Mar 30, 2025 | 1.65% (0.01649) | 80.31th | v4 (v2025.03.14) |
| Mar 29, 2025 | 5.81% (0.05807) | 83.77th | v4 (v2025.03.14) |
| Mar 17, 2025 | 1.65% (0.01649) | 80.74th | v4 (v2025.03.14) |
| Dec 12, 2024 | 0.21% (0.00214) | 60.32th | v3 (v2023.03.01) |
| May 29, 2024 | 0.21% (0.00211) | 59.00th | v3 (v2023.03.01) |
| Apr 18, 2024 | 0.23% (0.00227) | 60.62th | v3 (v2023.03.01) |
| Feb 8, 2024 | 0.32% (0.00323) | 69.89th | v3 (v2023.03.01) |
| Aug 25, 2023 | 0.32% (0.00323) | 66.91th | v3 (v2023.03.01) |
| Jul 8, 2023 | 0.32% (0.00315) | 66.16th | v3 (v2023.03.01) |
| Mar 28, 2023 | 0.26% (0.00256) | 61.76th | v3 (v2023.03.01) |
| Mar 7, 2023 | 0.23% (0.00227) | 59.12th | 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 | 4.27% (0.04270) | 74.64th | v1 |
| Jan 6, 2022 | 4.27% (0.04270) | 74.43th | v1 |
| Sep 1, 2021 | 4.27% (0.04270) | 83.53th | v1 |
| Apr 14, 2021 | 4.27% (0.04270) | 0.00th | v1 |
References (24)
- http://lists.opensuse.org/opensuse-security-announce/2019-07/msg00036.html vendor-advisoryx_refsource_SUSE
- http://www.securityfocus.com/bid/103739 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/errata/RHSA-2020:0542 vendor-advisoryx_refsource_REDHAT
- https://access.redhat.com/errata/RHSA-2020:0591 vendor-advisoryx_refsource_REDHAT
- https://access.redhat.com/errata/RHSA-2020:0663 vendor-advisoryx_refsource_REDHAT
- https://access.redhat.com/security/cve/CVE-2018-8780 Vendor Advisory
- https://bugzilla.redhat.com/show_bug.cgi?id=1561949 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-8780
- https://usn.ubuntu.com/3626-1/ vendor-advisoryx_refsource_UBUNTUThird Party Advisory
- https://www.cve.org/CVERecord?id=CVE-2018-8780
- https://www.debian.org/security/2018/dsa-4259 vendor-advisoryx_refsource_DEBIANThird Party Advisory
- https://www.ruby-lang.org/en/news/2018/03/28/poisoned-nul-byte-dir-cve-2018-8780/ 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.