CVE-2022-33127: Improper handling of double quotes in file name in Diffy in Windows environment
9.8
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.65369%
CWE
-
Published
6/24/2022
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:H/I:H/A:H
| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| diffy | rubygems | < 3.4.1 | 3.4.1 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stemmed from the Windows-specific code path in Diff::Diff#diff that constructed a command string using sprintf with user-controlled filenames wrapped in quotes. This approach used shell execution (via backticks) which doesn't properly handle argument escaping, allowing attackers to break out of the filename quoting and inject commands. The patch replaced this with Open3.capture3 which safely passes arguments without shell interpolation. The commit diff clearly shows removal of the vulnerable Windows-specific code block, confirming this was the attack vector.