CVE-2019-8320
RubyGems Delete directory using symlink when decompressing tar
Reported by mitre · Published June 6, 2019
rubygems-update is fixed in 3.0.3 and 2.7.9 (RubyGems)
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.
Fixed versions
Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.
| Package | Ecosystem | Fixed in |
|---|---|---|
| rubygems-update | RubyGems | 3.0.3, 2.7.9 |
| ruby | Alpine | 2.5.5-r0, 2.4.6-r0 |
| rubygems | rubygems | 3.0.2 |
Risk scores
Affected products
| Vendor | Product | Versions |
|---|---|---|
| n/a | n/a | n/a |
| alpine | ruby | 0, 0 |
| RubyGems | rubygems-update | 2.7.6 |
| n/a | n/a | * |
Timeline
- Apr 11, 2019 PoC Published
- Jun 6, 2019 CVE Published
- Apr 14, 2021 EPSS Score (30 in total, the first dated here)
- Mar 6, 2026 Distribution Patch (2 in total, the first dated here)
- Mar 6, 2026 Security Advisory (5 in total, the first dated here)
- Sep 7, 2026 Coalition ESS Score
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln CVE-2019-8320
vulnetix vdb fixes CVE-2019-8320
Or with curl, using the org id and key from your account page:
curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
"https://api.vdb.vulnetix.com/v2/vuln/CVE-2019-8320/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart
References
- x_refsource_MISC
- x_refsource_CONFIRM
- RHSA-2019:1429 vendor-advisoryx_refsource_REDHAT
- openSUSE-SU-2019:1771 vendor-advisoryx_refsource_SUSE
- [debian-lts-announce] 20200816 [SECURITY] [DLA 2330-1] jruby security update mailing-listx_refsource_MLIST
- https://nvd.nist.gov/vuln/detail/CVE-2019-8320 advisory