CVE-2021-28966:
Tempfile on Windows path traversal vulnerability
7.5
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.54884%
CWE
Published
5/6/2021
Updated
1/27/2023
KEV Status
No
Technology
Ruby
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
tmpdir | rubygems | < 0.1.2 | 0.1.2 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from tmpdir's handling of directory creation in Windows. The key evidence is:
- The advisory explicitly mentions Dir.mktmpdir as the vulnerable entry point
- The patch modifies UNUSABLE_CHARS to be more restrictive, indicating the original character whitelist was insufficient
- The test case changes show explicit testing for path traversal via both File::SEPARATOR and File::ALT_SEPARATOR
- The CWE-22 classification confirms this is a path limitation issue in directory/file creation functions
- The vulnerability manifests when user-supplied input flows into the prefix parameter of Dir.mktmpdir without proper sanitization