CVE-2019-8320
A Directory Traversal issue was discovered in RubyGems 2.7.6 and later through 3.0.2. Before making new directories or touching files (which now include path-checking code for symlinks), it would delete the target destination. If that destination was hidden behind a symlink, a malicious gem could delete arbitrary files on the user's machine, presuming the attacker could guess at paths. Given how frequently gem is run as sudo, and how predictable paths are on modern systems (/tmp, /usr, etc.), this could likely lead to data loss or an unusable system.
What to do
Fixed builds are available from AlmaLinux, Alpine, Debian, Red Hat, RubyGems, Ubuntu: see the table below for the fixed version per release.
Ubuntu has not shipped a fix for every release yet.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 26.04 | jruby | Not affected vulnerable_code_not_present | ||
| Ubuntu 25.10 | jruby | Not affected vulnerable_code_not_present | ||
| Ubuntu 24.04 | jruby | Not affected vulnerable_code_not_present | ||
| Ubuntu 20.04 | jruby | Not affected vulnerable_code_not_present | ||
| Ubuntu 18.04 | jruby | Fix pending | ||
| Ubuntu 18.04 | ruby2.5 | Fixed | 2.5.1-1ubuntu1.2 | UBUNTU-CVE-2019-8320 |
| Ubuntu 16.04 | jruby | Not affected vulnerable_code_not_present | ||
| Ubuntu 16.04 | ruby2.3 | Fixed | 2.3.1-2~16.04.12 | UBUNTU-CVE-2019-8320 |
| Ubuntu 14.04 | ruby1.9.1 | Fixed | 1.9.3.484-2ubuntu1.14 | UBUNTU-CVE-2019-8320 |
| Ubuntu 14.04 | ruby2.0 | Fixed | 2.0.0.484-1ubuntu2.13 | UBUNTU-CVE-2019-8320 |
| Debian 14 | jruby | Fixed | 9.1.17.0-3 | DEBIAN-CVE-2019-8320 |
| Debian 14 | rubygems | Fixed | 3.2.0~rc.1-1 | DEBIAN-CVE-2019-8320 |
| Debian 13 | jruby | Fixed | 9.1.17.0-3 | DEBIAN-CVE-2019-8320 |
| Debian 13 | rubygems | Fixed | 3.2.0~rc.1-1 | DEBIAN-CVE-2019-8320 |
| Debian 12 | jruby | Fixed | 9.1.17.0-3 | DEBIAN-CVE-2019-8320 |
| Debian 12 | rubygems | Fixed | 3.2.0~rc.1-1 | DEBIAN-CVE-2019-8320 |
| Red Hat Enterprise Linux 8 | ruby | Fixed | 0:2.5.5-105.module+el8.1.0+3656+f80bfa1d | RHBA-2019:3384 |
| Red Hat Enterprise Linux 8 | ruby-devel | Fixed | 0:2.5.5-105.module+el8.1.0+3656+f80bfa1d | RHBA-2019:3384 |
| Red Hat Enterprise Linux 8 | ruby-doc | Fixed | 0:2.5.5-105.module+el8.1.0+3656+f80bfa1d | RHBA-2019:3384 |
| Red Hat Enterprise Linux 8 | ruby-irb | Fixed | 0:2.5.5-105.module+el8.1.0+3656+f80bfa1d | RHBA-2019:3384 |
| Red Hat Enterprise Linux 8 | ruby-libs | Fixed | 0:2.5.5-105.module+el8.1.0+3656+f80bfa1d | RHBA-2019:3384 |
| Red Hat Enterprise Linux 8 | rubygem-abrt | Fixed | 0:0.3.0-4.module+el8.1.0+3656+f80bfa1d | RHBA-2019:3384 |
| Red Hat Enterprise Linux 8 | rubygem-abrt-doc | Fixed | 0:0.3.0-4.module+el8.1.0+3656+f80bfa1d | RHBA-2019:3384 |
| Red Hat Enterprise Linux 8 | rubygem-bigdecimal | Fixed | 0:1.3.4-105.module+el8.1.0+3656+f80bfa1d | RHBA-2019:3384 |
| Red Hat Enterprise Linux 8 | rubygem-bson | Fixed | 0:4.3.0-2.module+el8.1.0+3656+f80bfa1d | RHBA-2019:3384 |
| Red Hat Enterprise Linux 8 | rubygem-bson-doc | Fixed | 0:4.3.0-2.module+el8.1.0+3656+f80bfa1d | RHBA-2019:3384 |
| Red Hat Enterprise Linux 8 | rubygem-bundler | Fixed | 0:1.16.1-3.module+el8.1.0+3656+f80bfa1d | RHBA-2019:3384 |
| Red Hat Enterprise Linux 8 | rubygem-bundler-doc | Fixed | 0:1.16.1-3.module+el8.1.0+3656+f80bfa1d | RHBA-2019:3384 |
| Red Hat Enterprise Linux 8 | rubygem-did_you_mean | Fixed | 0:1.2.0-105.module+el8.1.0+3656+f80bfa1d | RHBA-2019:3384 |
| Red Hat Enterprise Linux 8 | rubygem-io-console | Fixed | 0:0.4.6-105.module+el8.1.0+3656+f80bfa1d | RHBA-2019:3384 |
| Red Hat Enterprise Linux 8 | rubygem-json | Fixed | 0:2.1.0-105.module+el8.1.0+3656+f80bfa1d | RHBA-2019:3384 |
| Red Hat Enterprise Linux 8 | rubygem-minitest | Fixed | 0:5.10.3-105.module+el8.1.0+3656+f80bfa1d | RHBA-2019:3384 |
| Red Hat Enterprise Linux 8 | rubygem-mongo | Fixed | 0:2.5.1-2.module+el8.1.0+3656+f80bfa1d | RHBA-2019:3384 |
| Red Hat Enterprise Linux 8 | rubygem-mongo-doc | Fixed | 0:2.5.1-2.module+el8.1.0+3656+f80bfa1d | RHBA-2019:3384 |
| Red Hat Enterprise Linux 8 | rubygem-mysql2 | Fixed | 0:0.4.10-4.module+el8.1.0+3656+f80bfa1d | RHBA-2019:3384 |
| Red Hat Enterprise Linux 8 | rubygem-mysql2-doc | Fixed | 0:0.4.10-4.module+el8.1.0+3656+f80bfa1d | RHBA-2019:3384 |
| Red Hat Enterprise Linux 8 | rubygem-net-telnet | Fixed | 0:0.1.1-105.module+el8.1.0+3656+f80bfa1d | RHBA-2019:3384 |
| Red Hat Enterprise Linux 8 | rubygem-openssl | Fixed | 0:2.1.2-105.module+el8.1.0+3656+f80bfa1d | RHBA-2019:3384 |
| Red Hat Enterprise Linux 8 | rubygem-pg | Fixed | 0:1.0.0-2.module+el8.1.0+3656+f80bfa1d | RHBA-2019:3384 |
| Red Hat Enterprise Linux 8 | rubygem-pg-doc | Fixed | 0:1.0.0-2.module+el8.1.0+3656+f80bfa1d | RHBA-2019:3384 |
| Red Hat Enterprise Linux 8 | rubygem-power_assert | Fixed | 0:1.1.1-105.module+el8.1.0+3656+f80bfa1d | RHBA-2019:3384 |
| Red Hat Enterprise Linux 8 | rubygem-psych | Fixed | 0:3.0.2-105.module+el8.1.0+3656+f80bfa1d | RHBA-2019:3384 |
| Red Hat Enterprise Linux 8 | rubygem-rake | Fixed | 0:12.3.0-105.module+el8.1.0+3656+f80bfa1d | RHBA-2019:3384 |
| Red Hat Enterprise Linux 8 | rubygem-rdoc | Fixed | 0:6.0.1-105.module+el8.1.0+3656+f80bfa1d | RHBA-2019:3384 |
| Red Hat Enterprise Linux 8 | rubygem-test-unit | Fixed | 0:3.2.7-105.module+el8.1.0+3656+f80bfa1d | RHBA-2019:3384 |
| Red Hat Enterprise Linux 8 | rubygem-xmlrpc | Fixed | 0:0.3.0-105.module+el8.1.0+3656+f80bfa1d | RHBA-2019:3384 |
| Red Hat Enterprise Linux 8 | rubygems | Fixed | 0:2.7.6.2-105.module+el8.1.0+3656+f80bfa1d | RHBA-2019:3384 |
| Red Hat Enterprise Linux 8 | rubygems-devel | Fixed | 0:2.7.6.2-105.module+el8.1.0+3656+f80bfa1d | RHBA-2019:3384 |
| Red Hat Enterprise Linux 7 | ruby | Not affected | ||
| Red Hat Enterprise Linux 7 | ruby-devel | Not affected | ||
| Red Hat Enterprise Linux 7 | ruby-doc | Not affected | ||
| Red Hat Enterprise Linux 7 | ruby-irb | Not affected | ||
| Red Hat Enterprise Linux 7 | ruby-libs | Not affected | ||
| Red Hat Enterprise Linux 7 | ruby-tcltk | Not affected | ||
| Red Hat Enterprise Linux 7 | rubygem-bigdecimal | Not affected | ||
| Red Hat Enterprise Linux 7 | rubygem-io-console | Not affected | ||
| Red Hat Enterprise Linux 7 | rubygem-json | Not affected | ||
| Red Hat Enterprise Linux 7 | rubygem-minitest | Not affected | ||
| Red Hat Enterprise Linux 7 | rubygem-psych | Not affected | ||
| Red Hat Enterprise Linux 7 | rubygem-rake | Not affected | ||
| Red Hat Enterprise Linux 7 | rubygem-rdoc | Not affected | ||
| Red Hat Enterprise Linux 7 | rubygems | Not affected | ||
| Red Hat Enterprise Linux 7 | rubygems-devel | Not affected | ||
| Red Hat Enterprise Linux 6 | rubygems | Not affected | ||
| AlmaLinux 8 | rubygem-abrt | Fixed | 0.3.0-4.module_el8.5.0+2623+08a8ba32 | ALBA-2019:3384 |
| AlmaLinux 8 | rubygem-abrt-doc | Fixed | 0.3.0-4.module_el8.5.0+2625+ec418553 | ALBA-2019:3384 |
| AlmaLinux 8 | rubygem-bson | Fixed | 4.3.0-2.module_el8.5.0+259+8cec6917 | ALBA-2019:3384 |
| AlmaLinux 8 | rubygem-bson-doc | Fixed | 4.3.0-2.module_el8.5.0+259+8cec6917 | ALBA-2019:3384 |
| AlmaLinux 8 | rubygem-mongo | Fixed | 2.5.1-2.module_el8.5.0+2625+ec418553 | ALBA-2019:3384 |
| AlmaLinux 8 | rubygem-mongo-doc | Fixed | 2.5.1-2.module_el8.5.0+259+8cec6917 | ALBA-2019:3384 |
| AlmaLinux 8 | rubygem-mysql2 | Fixed | 0.4.10-4.module_el8.5.0+259+8cec6917 | ALBA-2019:3384 |
| AlmaLinux 8 | rubygem-mysql2-doc | Fixed | 0.4.10-4.module_el8.5.0+259+8cec6917 | ALBA-2019:3384 |
| AlmaLinux 8 | rubygem-pg | Fixed | 1.0.0-2.module_el8.5.0+2625+ec418553 | ALBA-2019:3384 |
| AlmaLinux 8 | rubygem-pg-doc | Fixed | 1.0.0-2.module_el8.5.0+259+8cec6917 | ALBA-2019:3384 |
| Alpine Linux 3.9 | ruby | Fixed | 2.5.5-r0 | ALPINE-CVE-2019-8320 |
| Alpine Linux 3.8 | ruby | Fixed | 2.5.5-r0 | ALPINE-CVE-2019-8320 |
| Alpine Linux 3.7 | ruby | Fixed | 2.4.6-r0 | ALPINE-CVE-2019-8320 |
| Alpine Linux 3.6 | ruby | Fixed | 2.4.6-r0 | ALPINE-CVE-2019-8320 |
| RubyGems library | rubygems-update | Fixed | 3.0.3 | GHSA-5x32-c9mf-49cc |
What the vendor says
As published in the CVE record by mitre, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
Vendor advisories:
- https://access.redhat.com/errata/RHSA-2019:1429 (vendor-advisory)
- http://lists.opensuse.org/opensuse-security-announce/2019-07/msg00036.html (vendor-advisory)
References
- https://hackerone.com/reports/317321
- https://blog.rubygems.org/2019/03/05/security-advisories-2019-03.html
- https://access.redhat.com/errata/RHSA-2019:1429
- http://lists.opensuse.org/opensuse-security-announce/2019-07/msg00036.html
- https://lists.debian.org/debian-lts-announce/2020/08/msg00027.html
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.