CVE-2019-8320 json
RubyGems Delete directory using symlink when decompressing tar
published 2019-06-06 7 y ago modified 2026-06-17 4 mo ago also GHSA-5x32-c9mf-49cc , EUVD-2019-0506
- cvss
- 7.4
- version 3.0, NVD
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 4.2%
- EPSS 4.2% chance of exploitation in 30 days, percentile 91%
- public exploits
- 0
- none known
Summary
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.
Patch / fix
- rubygems rubygems-update 2.7.9, 3.0.3
- jruby Debian 14, Debian 13, Debian 12 9.1.17.0-3
- rubygems Debian 14, Debian 13, Debian 12 3.2.0~rc.1-1
debian advisories DEBIAN-CVE-2019-8320
- ruby2.0 Ubuntu 14.04 LTS 2.0.0.484-1ubuntu2.13
- ruby2.3 Ubuntu 16.04 LTS 2.3.1-2~16.04.12
- ruby2.5 Ubuntu 18.04 LTS 2.5.1-1ubuntu1.2
- ruby1.9.1 Ubuntu 14.04 LTS 1.9.3.484-2ubuntu1.14
ubuntu advisories UBUNTU-CVE-2019-8320
Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
- rh-ruby24-ruby RHEL 3 SOFTWARE_COLLECTIONS 2.4.6-92.el6
- rh-ruby24-ruby RHEL 3 SOFTWARE_COLLECTIONS 2.4.6-92.el7
- rh-ruby24-ruby-irb RHEL 3 SOFTWARE_COLLECTIONS 2.4.6-92.el6
- rh-ruby24-ruby-irb RHEL 3 SOFTWARE_COLLECTIONS 2.4.6-92.el7
- rh-ruby24-rubygems RHEL 3 SOFTWARE_COLLECTIONS 2.6.14.4-92.el6
- rh-ruby24-rubygems RHEL 3 SOFTWARE_COLLECTIONS 2.6.14.4-92.el7
- rh-ruby24-ruby-libs RHEL 3 SOFTWARE_COLLECTIONS 2.4.6-92.el6
- rh-ruby24-ruby-libs RHEL 3 SOFTWARE_COLLECTIONS 2.4.6-92.el7
red hat advisories RHSA-2019:1150RHSA-2019:1148RHSA-2019:1429RHBA-2019:3384
- ruby2.1 SLES for SAP 12 SP5, SLES for SAP 12 SP4, SLES for SAP 12 SP3 +14 more 2.1.9-19.3.2
- yast2-ruby-bindings SLES for SAP 12 SP2, SLES 12 SP2-LTSS, SLES 12 SP2-BCL +1 more 3.1.53-9.8.1
- ruby2.5 SLE Module for Basesystem 15 SP1, SLE Module for Basesystem 15 2.5.5-4.3.1
suse advisories SUSE-SU-2020:1570-1SUSE-SU-2019:1804-1
- ruby2.5 openSUSE Leap 15.1, openSUSE Leap 15.0 2.5.5-lp151.4.3.1
- ruby-bundled-gems-rpmhelper openSUSE Leap 15.1, openSUSE Leap 15.0 0.0.2-lp151.2.1
opensuse advisories openSUSE-SU-2019:1771-1
- rubygem-pg AlmaLinux 8 1.0.0-2.module_el8.5.0+2625+ec418553
- rubygem-pg AlmaLinux 8 1.0.0-2.module_el8.5.0+259+8cec6917
- rubygem-abrt AlmaLinux 8 0.3.0-4.module_el8.5.0+2625+ec418553
- rubygem-abrt AlmaLinux 8 0.3.0-4.module_el8.5.0+259+8cec6917
- rubygem-abrt AlmaLinux 8 0.3.0-4.module_el8.5.0+2623+08a8ba32
- rubygem-bson AlmaLinux 8 4.3.0-2.module_el8.5.0+2625+ec418553
- rubygem-bson AlmaLinux 8 4.3.0-2.module_el8.5.0+259+8cec6917
- rubygem-mongo AlmaLinux 8 2.5.1-2.module_el8.5.0+259+8cec6917
almalinux advisories ALBA-2019:3384
- ruby Alpine 3.7, Alpine 3.6 2.4.6-r0
- ruby Alpine 3.9, Alpine 3.8 2.5.5-r0
alpine advisories ALPINE-CVE-2019-8320
Alpine secdb © Alpine Linux, from https://secdb.alpinelinux.org via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2019-8320 updated cvss 7.4
rubygems: Delete directory using symlink when decompressing tar
-
Red Hat Software Collections rh-ruby23-ruby, rh-ruby23-ruby-irb, rh-ruby23-rubygems, rh-ruby23-ruby-libs, rh-ruby23-ruby-tcltk, rh-ruby23-rubygem-json, +10 moreaffected: no fix planned “Will not fix”
-
Red Hat CloudForms Management Engine 5.10 ruby 2.4.6-91.el7cf, cfme 5.10.5.1-1.el7cf, ruby-irb 2.4.6-91.el7cf, ruby-libs 2.4.6-91.el7cf, rubygems 2.6.14.4-91.el7cf, rubygem-rdoc 5.0.0-91.el7cf, +16 morefixed: vendor fix RHSA-2019:1429
-
Red Hat Enterprise Linux AppStream (v. 8) ruby 2.5.5-105.module+el8.1.0+3656+f80bfa1d, ruby-irb 2.5.5-105.module+el8.1.0+3656+f80bfa1d, rubygem-pg 1.0.0-2.module+el8.1.0+3656+f80bfa1d, ruby-libs 2.5.5-105.module+el8.1.0+3656+f80bfa1d, rubygem-abrt 0.3.0-4.module+el8.1.0+3656+f80bfa1d, rubygem-bson 4.3.0-2.module+el8.1.0+3656+f80bfa1d, +17 morefixed: vendor fix RHBA-2019:3384
-
Red Hat Software Collections for Red Hat Enterprise Linux Server (v. 6) rh-ruby24-ruby 2.4.6-92.el6, rh-ruby24-ruby-irb 2.4.6-92.el6, rh-ruby24-ruby-libs 2.4.6-92.el6, rh-ruby24-rubygems 2.6.14.4-92.el6, rh-ruby24-rubygem-json 2.0.4-92.el6, rh-ruby24-rubygem-rdoc 5.0.0-92.el6, +11 more Red Hat Software Collections for Red Hat Enterprise Linux Server (v. 7) rh-ruby25-ruby 2.5.5-7.el7, rh-ruby24-ruby 2.4.6-92.el7, rh-ruby25-ruby-irb 2.5.5-7.el7, rh-ruby24-ruby-irb 2.4.6-92.el7, rh-ruby25-ruby-libs 2.5.5-7.el7, rh-ruby24-ruby-libs 2.4.6-92.el7, +28 more Red Hat Software Collections for Red Hat Enterprise Linux Server EUS (v. 7.4) rh-ruby25-ruby 2.5.5-7.el7, rh-ruby24-ruby 2.4.6-92.el7, rh-ruby25-ruby-irb 2.5.5-7.el7, rh-ruby24-ruby-irb 2.4.6-92.el7, rh-ruby25-ruby-libs 2.5.5-7.el7, rh-ruby24-ruby-libs 2.4.6-92.el7, +28 more Red Hat Software Collections for Red Hat Enterprise Linux Server EUS (v. 7.5) rh-ruby25-ruby 2.5.5-7.el7, rh-ruby24-ruby 2.4.6-92.el7, rh-ruby25-ruby-irb 2.5.5-7.el7, rh-ruby24-ruby-irb 2.4.6-92.el7, rh-ruby25-ruby-libs 2.5.5-7.el7, rh-ruby24-ruby-libs 2.4.6-92.el7, +28 more Red Hat Software Collections for Red Hat Enterprise Linux Server EUS (v. 7.6) rh-ruby25-ruby 2.5.5-7.el7, rh-ruby24-ruby 2.4.6-92.el7, rh-ruby25-ruby-irb 2.5.5-7.el7, rh-ruby24-ruby-irb 2.4.6-92.el7, rh-ruby25-ruby-libs 2.5.5-7.el7, rh-ruby24-ruby-libs 2.4.6-92.el7, +28 more Red Hat Software Collections for Red Hat Enterprise Linux Workstation (v. 6) rh-ruby24-ruby 2.4.6-92.el6, rh-ruby24-ruby-irb 2.4.6-92.el6, rh-ruby24-ruby-libs 2.4.6-92.el6, rh-ruby24-rubygems 2.6.14.4-92.el6, rh-ruby24-rubygem-json 2.0.4-92.el6, rh-ruby24-rubygem-rdoc 5.0.0-92.el6, +11 morefixed: vendor fix RHSA-2019:1150
+1 more productsfewer
Red Hat Software Collections for Red Hat Enterprise Linux Workstation (v. 7) rh-ruby25-ruby 2.5.5-7.el7, rh-ruby24-ruby 2.4.6-92.el7, rh-ruby25-ruby-irb 2.5.5-7.el7, rh-ruby24-ruby-irb 2.4.6-92.el7, rh-ruby25-ruby-libs 2.5.5-7.el7, rh-ruby24-ruby-libs 2.4.6-92.el7, +28 more -
Red Hat Enterprise Linux 6 rubygems Red Hat Enterprise Linux 7 ruby, ruby-irb, rubygems, ruby-libs, ruby-tcltk, rubygem-json, +6 more Red Hat Software Collections rh-ruby26-ruby, rh-ruby26-rubygems, rh-ruby26-ruby-libs, rh-ruby26-rubygem-irb, rh-ruby26-rubygem-json, rh-ruby26-rubygem-rake, +12 morenot affected: vulnerable code not present
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
Exploit prediction
4.19% chance of exploitation in the next 30 days, higher than 91% of all scored CVEs (FIRST EPSS, 2026-11-08).
Exploits and checks
- hackerone.com https://hackerone.com/reports/317321 referenced PoC, tagged "exploit" by a source, unverified
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| NVD | 3.0 | 7.4 | CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:H |
| NVD | 2.0 | 8.8 | AV:N/AC:M/Au:N/C:N/I:C/A:C |
| GitHub | 3.0 | 7.4 | CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:H |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| rubygems | rubygems-update | >=2.7.6, <2.7.9 >=3.0.0, <3.0.3 |
2.7.9 3.0.3 |
Classification
- Weakness
-
- CWE-22 Improper Limitation of a Pathname to a Restricted Directory
References
-
hackerone.com
/reports/317321
web, exploit, third-party-advisory
-
access.redhat.com
/errata/RHSA-2019:1429
vendor-advisory, web
-
lists.opensuse.org
/opensuse-security-announce/2019-07/msg00036.html
vendor-advisory, web
-
blog.rubygems.org
/2019/03/05/security-advisories-2019-03.html
web, vendor-advisory
-
lists.debian.org
/debian-lts-announce/2020/08/msg00027.html
mailing-list, web
-
nvd.nist.gov
/vuln/detail/CVE-2019-8320
advisory
-
github.com
/rubygems/rubygems
package
-
github.com
/rubysec/ruby-advisory-db/blob/master/gems/rubygems-update/CVE-2019-8320.yml
web
Sources
- CVE List CVE-2019-8320
- GitHub Advisory GHSA-5x32-c9mf-49cc
- NVD CVE-2019-8320
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.