A Directory Traversal issue was discovered in RubyGems 2.7.6 and later through 3.0.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.
Noroxi analysis
No Noroxi analysis for this record yet
We don't hand-write analysis for the hundreds of thousands of vulnerabilities in the database; that wouldn't be honest. For notable, high-impact vulnerabilities our team writes the mechanism, detection and remediation steps.
We use this product, ask for help- Published
- Jun 6, 2019
- Updated
- Jun 16, 2026
- EPSS
- 4.2% · 91th percentile
- CWE
- CWE-22
Sign in to follow · You’ll be notified if a followed record enters KEV, gets an exploit or is updated.
Report tools
Action score
30
Monitor
Low priority for now.
- CVSS
- 29 / 40 · 7.4 / 10
- CISA KEV
- 0 / 30 · Not listed
- EPSS
- 1 / 30 · 4.2%
Affected systems
| Vendor | Product | CPE |
|---|---|---|
| rubygems | rubygems | cpe:2.3:a:rubygems:rubygems |
Affected versions
NVD version ranges (for catalog products). Add the product to your stack with a version and matching uses these.
- rubygems rubygems2.7.6 and later · up to 3.0.2 inclusive
Package-level exposure
OSV and GitHub Advisory data: ecosystem, package and range. SBOM matching uses this table.
| Ecosystem | Package | Affected range | Fix |
|---|---|---|---|
| Alpine:v3.6 | ruby | before 2.4.6-r0 | 2.4.6-r0 |
| Alpine:v3.8 | ruby | before 2.5.5-r0 | 2.5.5-r0 |
| Debian:12 | jruby | before 9.1.17.0-3 | 9.1.17.0-3 |
| Debian:12 | rubygems | before 3.2.0~rc.1-1 | 3.2.0~rc.1-1 |
| Debian:8 | ruby2.1 | before 2.1.5-2+deb8u7 | 2.1.5-2+deb8u7 |
| Debian:9 | jruby | before 1.7.26-1+deb9u2 | 1.7.26-1+deb9u2 |
| Debian:9 | ruby2.3 | before 2.3.3-1+deb9u6 | 2.3.3-1+deb9u6 |
| openSUSE:Leap 15.0 | ruby-bundled-gems-rpmhelper | before 0.0.2-lp151.2.1 | 0.0.2-lp151.2.1 |
| openSUSE:Leap 15.0 | ruby2.5 | before 2.5.5-lp151.4.3.1 | 2.5.5-lp151.4.3.1 |
| Red Hat:cloudforms_managementengine:5.10::el7 | cfme | before 0:5.10.5.1-1.el7cf | 0:5.10.5.1-1.el7cf |
| Red Hat:cloudforms_managementengine:5.10::el7 | cfme-amazon-smartstate | before 0:5.10.5.1-1.el7cf | 0:5.10.5.1-1.el7cf |
| Red Hat:cloudforms_managementengine:5.10::el7 | cfme-appliance | before 0:5.10.5.1-1.el7cf | 0:5.10.5.1-1.el7cf |
| Red Hat:cloudforms_managementengine:5.10::el7 | cfme-appliance-common | before 0:5.10.5.1-1.el7cf | 0:5.10.5.1-1.el7cf |
| Red Hat:cloudforms_managementengine:5.10::el7 | cfme-appliance-debuginfo | before 0:5.10.5.1-1.el7cf | 0:5.10.5.1-1.el7cf |
| Red Hat:cloudforms_managementengine:5.10::el7 | cfme-appliance-tools | before 0:5.10.5.1-1.el7cf | 0:5.10.5.1-1.el7cf |
| Red Hat:cloudforms_managementengine:5.10::el7 | cfme-debuginfo | before 0:5.10.5.1-1.el7cf | 0:5.10.5.1-1.el7cf |
| Red Hat:cloudforms_managementengine:5.10::el7 | cfme-gemset | before 0:5.10.5.1-1.el7cf | 0:5.10.5.1-1.el7cf |
| Red Hat:cloudforms_managementengine:5.10::el7 | cfme-gemset-debuginfo | before 0:5.10.5.1-1.el7cf | 0:5.10.5.1-1.el7cf |
| Red Hat:cloudforms_managementengine:5.10::el7 | ruby | before 0:2.4.6-91.el7cf | 0:2.4.6-91.el7cf |
| Red Hat:cloudforms_managementengine:5.10::el7 | ruby-debuginfo | before 0:2.4.6-91.el7cf | 0:2.4.6-91.el7cf |
| Red Hat:cloudforms_managementengine:5.10::el7 | ruby-devel | before 0:2.4.6-91.el7cf | 0:2.4.6-91.el7cf |
| Red Hat:cloudforms_managementengine:5.10::el7 | ruby-doc | before 0:2.4.6-91.el7cf | 0:2.4.6-91.el7cf |
| Red Hat:cloudforms_managementengine:5.10::el7 | ruby-irb | before 0:2.4.6-91.el7cf | 0:2.4.6-91.el7cf |
| Red Hat:cloudforms_managementengine:5.10::el7 | ruby-libs | before 0:2.4.6-91.el7cf | 0:2.4.6-91.el7cf |
+96
Same product
rubygems: all recordsOther highest-scoring records for the same primary product.
- CVE-2017-0903RubyGems versions between 2.0.0 and 2.6.13 are vulnerable to a possible remote code execution vulnerability.44Plan
- CVE-2017-0899RubyGems version 2.6.12 and earlier is vulnerable to maliciously crafted gem specifications that include terminal escape characters.42Plan
- CVE-2018-1000076RubyGems version Ruby 2.2 series: 2.2.9 and earlier, Ruby 2.3 series: 2.3.6 and earlier, Ruby 2.4 series: 2.4.3 and earlier, Ruby 2.5 series40Plan
- CVE-2017-0901RubyGems version 2.6.12 and earlier fails to validate specification names, allowing a maliciously crafted gem to potentially overwrite any f39Monitor
- CVE-2019-8324An issue was discovered in RubyGems 2.6 and later through 3.0.2.36Monitor
- CVE-2022-36073RubyGems allows creation of users with arbitrary unverified emails35Monitor
Remediation
Which version to upgrade to
Fix versions compiled from the vendor, package registries and Microsoft. Verify the vendor's note before upgrading.
| Product / package | Fixed version | Source |
|---|---|---|
| alpine:ruby | 2.4.6-r0 · Alpine:v3.6 | Package registry (OSV) |
| debian:jruby | 9.1.17.0-3 · Debian:12 | Package registry (OSV) |
| debian:ruby2.1 | 2.1.5-2+deb8u7 · Debian:8 | Package registry (OSV) |
| debian:ruby2.3 | 2.3.3-1+deb9u6 · Debian:9 | Package registry (OSV) |
| debian:rubygems | 3.2.0~rc.1-1 · Debian:12 | Package registry (OSV) |
| opensuse:ruby-bundled-gems-rpmhelper | 0.0.2-lp151.2.1 · openSUSE:Leap 15.0 | Package registry (OSV) |
| opensuse:ruby2.5 | 2.5.5-lp151.4.3.1 · openSUSE:Leap 15.0 | Package registry (OSV) |
| red hat:ruby | 0:2.5.5-105.module+el8.1.0+3656+f80bfa1d · Red Hat:enterprise_linux:8::appstream | Package registry (OSV) |
| red hat:ruby-debuginfo | 0:2.5.5-105.module+el8.1.0+3656+f80bfa1d · Red Hat:enterprise_linux:8::appstream | Package registry (OSV) |
| red hat:ruby-debugsource | 0:2.5.5-105.module+el8.1.0+3656+f80bfa1d · Red Hat:enterprise_linux:8::appstream | Package registry (OSV) |
| red hat:ruby-devel | 0:2.5.5-105.module+el8.1.0+3656+f80bfa1d · Red Hat:enterprise_linux:8::appstream | Package registry (OSV) |
| red hat:ruby-doc | 0:2.5.5-105.module+el8.1.0+3656+f80bfa1d · Red Hat:enterprise_linux:8::appstream | Package registry (OSV) |
| red hat:ruby-irb | 0:2.5.5-105.module+el8.1.0+3656+f80bfa1d · Red Hat:enterprise_linux:8::appstream | Package registry (OSV) |
| red hat:ruby-libs | 0:2.5.5-105.module+el8.1.0+3656+f80bfa1d · Red Hat:enterprise_linux:8::appstream | Package registry (OSV) |
| red hat:ruby-libs-debuginfo | 0:2.5.5-105.module+el8.1.0+3656+f80bfa1d · Red Hat:enterprise_linux:8::appstream | Package registry (OSV) |
| red hat:rubygem-abrt | 0:0.3.0-4.module+el8.1.0+3656+f80bfa1d · Red Hat:enterprise_linux:8::appstream | Package registry (OSV) |
| red hat:rubygem-abrt-doc | 0:0.3.0-4.module+el8.1.0+3656+f80bfa1d · Red Hat:enterprise_linux:8::appstream | Package registry (OSV) |
| red hat:rubygem-bigdecimal | 0:1.3.4-105.module+el8.1.0+3656+f80bfa1d · Red Hat:enterprise_linux:8::appstream | Package registry (OSV) |
| red hat:rubygem-bigdecimal-debuginfo | 0:1.3.4-105.module+el8.1.0+3656+f80bfa1d · Red Hat:enterprise_linux:8::appstream | Package registry (OSV) |
| RubyGems:rubygems-update | 2.7.9 | Package registry (OSV) |
| RubyGems:rubygems-update | 3.0.3 | Package registry (OSV) |
| suse:ruby2.5 | 2.5.5-4.3.1 · SUSE:Linux Enterprise Module for Basesystem 15 | Package registry (OSV) |
Exploit status
No known public exploit
No public exploit has been observed yet. That doesn't mean you're safe, only that the bar is a little higher.
Research context
For pentesters and researchers: attack profile, score disagreement, timeline, patch commits, credits, variant and chain candidates, bug bounty scope. All derived from existing data; no exploit code.
Timeline
From publication to today: proof of concept, Metasploit module, CISA KEV and fix record. Dates are as reported by the sources.
No dated events beyond publication.
FIRST EPSS daily score; only changes of 0.01 or more are recorded (step chart).
Patch and commit links
Commit, PR and diff links among the references. A starting point for patch-diffing and variant hunting; fixes, not exploits.
No commit or PR link among the references.
Credits
All researchersFinders, reporters and analysts named in the CNA record. Click a name for that researcher’s other records.
No credits in the CNA record.
Variant candidates
Same product, same weakness class, within 18 months. If the patch missed the root cause, the sibling bug is here.
No nightly-computed relations.
Chain candidates
An authentication bypass and a privilege-requiring bug in the same product, published close together: combined they may become an unauthenticated path.
—
Bug bounty scope
- RubyGemsHackerOne · disclosure only (VDP) · rubygems/rubygems
- RubyGemsHackerOne · disclosure only (VDP)
The product’s vendor appears in a public program. Matched by name; verify the scope text in the program.
Technical details
Attack conditions
- Anyone who can reach it over the internet can trigger it.
- No account or password is required.
- No user action is required.
- Special conditions such as timing or configuration are required.
If successful
- Confidentiality
- none
- Integrity
- high · data or configuration can be modified
- Availability
- high · the service can be disrupted
- Attack vector
- Network
- Attack complexity
- High
- Privileges required
- None
- User interaction
- None
- Scope
- Unchanged
- Confidentiality impact
- None
- Integrity impact
- High
- Availability impact
- High
Weakness class (CWE)
CWE-22 · Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')CVSS vector
CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:H
nvd-primary
Root cause
A user-supplied file name is joined with the allowed directory, but the result is never checked to confirm it is still inside that directory.
The bug in code
The whole CWE-22 classA representative example of this vulnerability class. Not the vendor's source code; it shows the faulty pattern and its fix.
Vulnerable
const file = path.join(ROOT, req.query.name);res.sendFile(file);Fixed
const file = path.resolve(ROOT, req.query.name);if (!file.startsWith(ROOT + path.sep)) { return res.sendStatus(400);}res.sendFile(file);Attack context
MITRE CAPEC attack patterns and ATT&CK techniques for this weakness class (CWE). A starting point for detection rules and threat hunting.
Attack patterns (CAPEC)
- Path TraversalCAPEC-126likelihood: High · Very High
- Using Slashes and URL Encoding Combined to Bypass Validation LogicCAPEC-64likelihood: High · High
- Manipulating Web Input to File System CallsCAPEC-76likelihood: High · Very High
- Using Escaped Slashes in Alternate EncodingCAPEC-78likelihood: High · High
- Using Slashes in Alternate EncodingCAPEC-79likelihood: High · High
ATT&CK techniques
—
Change log
- Fix✗ → ✓
For records you follow, these changes also arrive as notifications. →
References
- lists.opensuse.org/opensuse-security-announce/2019-07/msg00036.html
- access.redhat.com/errata/RHSA-2019:1429
- blog.rubygems.org/2019/03/05/security-advisories-2019-03.html
- lists.debian.org/debian-lts-announce/2020/08/msg00027.html
Vendor advisories and official records. Exploit/PoC links are deliberately left out.