Vulnerability record · CVE-2021-28966 · published 30 July 2021
CVE-2021-28966: Ruby TmpDir path traversal on Windows allows crafted path injection
Ruby Lang · Ruby
Ruby through 3.0 on Windows mishandles paths when a web application passes a parameter to TmpDir, allowing a crafted path to escape the intended temporary directory. This is a path traversal flaw (CWE-22) that matters because untrusted input reaching TmpDir can redirect file operations outside the temp directory.
Description
In Ruby through 3.0 on Windows, a remote attacker can submit a crafted path when a Web application handles a parameter with TmpDir.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
Automated analysis
high priorityCVSS 7.5 with network reachability, no authentication, and high EPSS plus an exploit-tagged reference make this a serious integrity risk despite no KEV listing.
What it is
Ruby through 3.0 on Windows mishandles paths when a web application passes a parameter to TmpDir, allowing a crafted path to escape the intended temporary directory. This is a path traversal flaw (CWE-22) that matters because untrusted input reaching TmpDir can redirect file operations outside the temp directory.
Impact
An attacker can influence where temporary files are created or accessed, enabling writes or reads outside the intended directory. The CVSS vector shows no confidentiality impact but high integrity impact, so the primary gain is tampering with files.
Attack surface
Reached remotely over the network (AV:N) with no authentication (PR:N) and no user interaction (UI:N) when a web application passes an attacker-controlled parameter to TmpDir. The flaw is specific to Ruby on Windows.
Exploitation
Not listed in CISA KEV, but EPSS is 0.57133 (99th percentile) and the HackerOne reference is tagged Exploit, indicating public exploit detail exists.
What to do
- Upgrade Ruby to a version after 3.0 that contains the fix referenced in the HackerOne report.
- Validate and sanitize any user-supplied value passed to TmpDir; do not accept raw path input.
- Run Ruby web applications with least privilege and restrict write access to the temp directory.
- Apply vendor advisories (for example NetApp) for affected bundled Ruby components.
Detection
- Monitor for TmpDir usage where the path argument originates from request parameters.
- Alert on file creation or access events outside the expected temp directory by Ruby processes.
- Review web application logs for path traversal patterns in parameters feeding temp file handling.
This assessment is produced automatically and is not human-reviewed. Verify against the vendor advisory before acting on it.
Affected products
1 vulnerable configurations from NVD's CPE data, grouped by vendor and product.
References
| Link | Tags |
|---|---|
| https://hackerone.com/reports/1131465 | ExploitIssue TrackingPatchThird Party Advisory |
| https://security.netapp.com/advisory/ntap-20210902-0004/ | Third Party Advisory |
| https://hackerone.com/reports/1131465 | ExploitIssue TrackingPatchThird Party Advisory |
| https://security.netapp.com/advisory/ntap-20210902-0004/ | Third Party Advisory |
Track CVE-2021-28966 inside VULONE
Watch it alongside the ransomware crews, C2 infrastructure and forum chatter that reference it, query it through the API and pull it into your SIEM over TAXII.
Related vulnerabilities
Same products first, then exploited flaws of the same weakness class.
Source: NIST National Vulnerability Database (record CVE-2021-28966), CISA KEV, FIRST EPSS (scores of 2026-09-26). This page is refreshed as NVD updates the record.