---
id: CVE-2026-107704
title: >-
  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 ena…
summary: >-
  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 ena…
severity: critical
cvss: 9.8
cvssVector: 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H'
cwe:
  - CWE-78
published: '2026-10-08'
updated: '2026-10-09'
sourceUpdated: '2026-10-09T15:17:08.667'
source: NVD
sourceUrl: 'https://nvd.nist.gov/vuln/detail/CVE-2026-107704'
references:
  - url: 'https://gist.github.com/R3tro16/a99a058d24a06692721a6a3fade9649d'
    label: disclosure@vulncheck.com
  - url: 'https://github.com/jtescher/image_optimizer'
    label: disclosure@vulncheck.com
  - url: >-
      https://github.com/jtescher/image_optimizer/blob/v1.9.0/lib/image_optimizer.rb#L37-L47
    label: disclosure@vulncheck.com
  - url: >-
      https://github.com/jtescher/image_optimizer/blob/v1.9.0/lib/image_optimizer/shell.rb#L30-L32
    label: disclosure@vulncheck.com
  - url: >-
      https://www.vulncheck.com/advisories/image-optimizer-1.3.0-through-1.9.0-os-command-injection-via-identify-format
    label: disclosure@vulncheck.com
  - url: 'https://gist.github.com/R3tro16/a99a058d24a06692721a6a3fade9649d'
    label: 134c704f-9b21-4f2e-91b3-4a467353bcc0
tags:
  - nvd
epss: 0.01663
epssPercentile: 0.76009
ingestedAt: '2026-10-08T20:06:22.189Z'
---

## Overview

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.

## Remediation

Refer to the linked advisories for vendor-supplied fixes and affected version ranges.
