CVE-2019-13574:
OS Command Injection in MiniMagick
7.8
CVSS Score
3.0
Basic Information
CVE ID
GHSA ID
EPSS Score
0.96378%
CWE
Published
7/18/2019
Updated
8/29/2023
KEV Status
No
Technology
Ruby
Technical Details
CVSS Vector
CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
mini_magick | rubygems | < 4.9.4 | 4.9.4 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from the pre-patch implementation of MiniMagick::Image.open
in lib/mini_magick/image.rb
, which used Kernel#open
to handle input. Kernel#open
has dangerous behavior where strings starting with |
execute shell commands. The patch replaced Kernel#open
with URI.open
for HTTP/FTP and File.open
for local files, which neutralizes this vector. The added test case "| touch file.txt"
in the spec file demonstrates the exploit attempt, which would have succeeded with the vulnerable Kernel#open
implementation.