CVE-2022-33127 — Improper handling of double quotes in diffy
Improper handling of double quotes in file name in Diffy in Windows environment
What Should I Do?
Address in Next Maintenance Window
Low exploitation probability (2.10%). Schedule for your next planned update.
Does your project use an affected diffy version?
Paste your Gemfile.lock to check it for CVE-2022-33127 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.
Summary
The function that calls the diff tool in versions of Diffy prior to 3.4.1 does not properly handle double quotes in a filename when run in a Windows environment. This allows attackers to execute arbitrary commands via a crafted string.
Advisory Timeline
- First published June 24, 2022 (1616 days ago).
- Last revised December 8, 2024 — 898 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
gem install diffy -v 3.4.1
After upgrading, scan your dependencies again to confirm the vulnerability is resolved.
Affected Packages (1)
Affects 1 ecosystem: RubyGems (1).
| Package | Fixed In |
|---|---|
| diffy RubyGems · Affected: 1.1.0, 2.0.0, 2.0.1, 2.0.10 (+26 more) | 3.4.1 |
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 9.8 score means for each attack dimension.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
References
- https://nvd.nist.gov/vuln/detail/CVE-2022-33127ADVISORY
- https://github.com/samg/diffy/commit/478f392082b66d38f54a02b4bb9c41be32fd6593WEB
- https://github.com/rubysec/ruby-advisory-db/blob/master/gems/diffy/CVE-2022-33127.ymlWEB
- https://github.com/samg/diffyPACKAGE
- https://github.com/samg/diffy/blob/56fd935aea256742f7352b050592542d3d153bf6/CHANGELOG#L1WEB
Frequently Asked Questions
- What is CVE-2022-33127?
- Improper handling of double quotes in file name in Diffy in Windows environment. This vulnerability has been assigned a severity rating of CRITICAL (CVSS score: 9.8/10).
- How do I check if my project is affected by CVE-2022-33127?
- CVE-2022-33127 affects diffy. It has a 2.1% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2022-33127 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Maximum impact if exploited, often with little effort or access required.
This places it in the top quartile of EPSS-scored vulnerabilities — 82.3% of tracked vulnerabilities score at or below it, so it is more likely to be exploited than most of the tracked corpus.
Also Known As
Related CVEs
- CVE-2026-130001CRITICAL
Mustache for Ruby: RCE using built-in method access
- CVE-2026-122006CRITICAL
Active Storage: Possible arbitrary file write and read in image analysis