CVE-2019-8320
published 2019-06-06CVE-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…
PriorityP346high7.4CVSS 3.0
AVNACHPRNUINSUCNIHAH
EPSS
4.21%
89.9th percentile
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.
Affected
10 ranges
| Vendor | Product | Version range | Fixed in |
|---|---|---|---|
| debian | jruby | < jruby 9.1.17.0-3 (bookworm) | jruby 9.1.17.0-3 (bookworm) |
| debian | rubygems | < jruby 9.1.17.0-3 (bookworm) | jruby 9.1.17.0-3 (bookworm) |
| jruby | jruby | >= 0 < 9.1.17.0-3 | 9.1.17.0-3 |
| jruby | jruby | >= 0 < 9.1.17.0-3 | 9.1.17.0-3 |
| jruby | jruby | >= 0 < 9.1.17.0-3 | 9.1.17.0-3 |
| rubygems | rubygems | >= 0 < 3.2.0~rc.1-1 | 3.2.0~rc.1-1 |
| rubygems | rubygems | >= 0 < 3.2.0~rc.1-1 | 3.2.0~rc.1-1 |
| rubygems | rubygems | >= 0 < 3.2.0~rc.1-1 | 3.2.0~rc.1-1 |
| rubygems | rubygems | >= 0 < 3.2.0~rc.1-1 | 3.2.0~rc.1-1 |
| rubygems | rubygems | 2.7.6 – 3.0.2 | — |
CVSS provenance
nvdv3.07.4HIGHCVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:H
nvdv2.08.8HIGHAV:N/AC:M/Au:N/C:N/I:C/A:C
osv7.4HIGH
vendor_debian7.4HIGH
vendor_redhat7.4HIGH
vendor_ubuntu7.4HIGH
Stop checking back — get the weekly exploitation signal.
Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.
GHSA
RubyGems Delete directory using symlink when decompressing tar
ghsa·2019-06-20
CVE-2019-8320 [HIGH] CWE-22 RubyGems Delete directory using symlink when decompressing tar
RubyGems Delete directory using symlink when decompressing tar
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.
OSV
RubyGems Delete directory using symlink when decompressing tar
osv·2019-06-20
CVE-2019-8320 [HIGH] RubyGems Delete directory using symlink when decompressing tar
RubyGems Delete directory using symlink when decompressing tar
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.
OSV
CVE-2019-8320: A Directory Traversal issue was discovered in RubyGems 2
osv·2019-06-06·CVSS 7.4
CVE-2019-8320 [HIGH] CVE-2019-8320: A Directory Traversal issue was discovered in RubyGems 2
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.
OSV
ruby1.9.1, ruby2.0, ruby2.3, ruby2.5 vulnerabilities
osv·2019-04-11·CVSS 7.4
CVE-2019-8320 [HIGH] ruby1.9.1, ruby2.0, ruby2.3, ruby2.5 vulnerabilities
ruby1.9.1, ruby2.0, ruby2.3, ruby2.5 vulnerabilities
It was discovered that Ruby incorrectly handled certain RubyGems.
An attacker could possibly use this issue to execute arbitrary commands.
(CVE-2019-8320)
It was discovered that Ruby incorrectly handled certain inputs.
An attacker could possibly use this issue to execute arbitrary code.
(CVE-2019-8321, CVE-2019-8322, CVE-2019-8323, CVE-2019-8324, CVE-2019-8325)
Ubuntu
Ruby vulnerabilities
vendor_ubuntu·2019-04-11·CVSS 7.4
CVE-2019-8320 [HIGH] Ruby vulnerabilities
Title: Ruby vulnerabilities
Summary: Several security issues were fixed in Ruby.
It was discovered that Ruby incorrectly handled certain RubyGems.
An attacker could possibly use this issue to execute arbitrary commands.
(CVE-2019-8320)
It was discovered that Ruby incorrectly handled certain inputs.
An attacker could possibly use this issue to execute arbitrary code.
(CVE-2019-8321, CVE-2019-8322, CVE-2019-8323, CVE-2019-8324, CVE-2019-8325)
Instructions: In general, a standard system update will make all the necessary changes.
Red Hat
rubygems: Delete directory using symlink when decompressing tar
vendor_redhat·2019-03-05·CVSS 7.4
CVE-2019-8320 [HIGH] CWE-22 rubygems: Delete directory using symlink when decompressing tar
rubygems: Delete directory using symlink when decompressing tar
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.
Package: rubygems (Red Hat Enterprise Linux 6) - Not affected
Package: ruby (Red Hat Enterprise Linux 7) - Not affected
Package: rh-ruby23-ruby (Red Hat Software Collections)
Debian
CVE-2019-8320: jruby - A Directory Traversal issue was discovered in RubyGems 2.7.6 and later through 3...
vendor_debian·2019·CVSS 7.4
CVE-2019-8320 [HIGH] CVE-2019-8320: jruby - A Directory Traversal issue was discovered in RubyGems 2.7.6 and later through 3...
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.
Scope: local
bookworm: resolved (fixed in 9.1.17.0-3)
forky: resolved (fixed in 9.1.17.0-3)
sid: resolved (fixed in 9.1.17.0-3)
trixie: resolved (fixed in 9.1.17.0-3)
No detection rules found.
No public exploits indexed.
Bugzilla
CVE-2019-8320 CVE-2019-8321 CVE-2019-8322 CVE-2019-8323 CVE-2019-8324 CVE-2019-8325 rubygems: various flaws [fedora-all]
bugzilla·2019-03-25·CVSS 7.4
CVE-2019-8320 [HIGH] CVE-2019-8320 CVE-2019-8321 CVE-2019-8322 CVE-2019-8323 CVE-2019-8324 CVE-2019-8325 rubygems: various flaws [fedora-all]
CVE-2019-8320 CVE-2019-8321 CVE-2019-8322 CVE-2019-8323 CVE-2019-8324 CVE-2019-8325 rubygems: various flaws [fedora-all]
This is an automatically created tracking bug! It was created to ensure
that one or more security vulnerabilities are fixed in affected versions
of fedora-all.
For comments that are specific to the vulnerability please use bugs filed
against the "Security Response" product referenced in the "Blocks" field.
For more information see:
http://fedoraproject.org/wiki/Security/TrackingBugs
When submitting as an update, use the fedpkg template provided in the next
comment(s). This will include the bug IDs of this tracking bug as well as
the relevant top-level CVE bugs.
Please also mention the CVE IDs being fixed in the RPM changelog and the
fedpkg commit message.
NOTE: thi
Bugzilla
CVE-2019-8320 rubygems: Delete directory using symlink when decompressing tar
bugzilla·2019-03-25·CVSS 7.4
CVE-2019-8320 [HIGH] CVE-2019-8320 rubygems: Delete directory using symlink when decompressing tar
CVE-2019-8320 rubygems: Delete directory using symlink when decompressing tar
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.
Upstream patch:
https://bugs.ruby-lang.org/attachments/7669
References:
https://www.ruby-lang.org/en/news/2019/03/05/multiple-vulnerabilities-in-rubygems/
https
http://lists.opensuse.org/opensuse-security-announce/2019-07/msg00036.htmlhttps://access.redhat.com/errata/RHSA-2019:1429https://blog.rubygems.org/2019/03/05/security-advisories-2019-03.htmlhttps://hackerone.com/reports/317321https://lists.debian.org/debian-lts-announce/2020/08/msg00027.htmlhttp://lists.opensuse.org/opensuse-security-announce/2019-07/msg00036.htmlhttps://access.redhat.com/errata/RHSA-2019:1429https://blog.rubygems.org/2019/03/05/security-advisories-2019-03.htmlhttps://hackerone.com/reports/317321https://lists.debian.org/debian-lts-announce/2020/08/msg00027.html
2019-06-06
Published