---
title: "CVE-2026-107704: image_optimizer Ruby gem - Command Injection"
description: "image_optimizer Ruby gem 1.3.0 through 1.9.0 contains a command injection caused by improper sanitization of image path in ImageOptimizer#identify_format, letting attackers execute OS commands with Ruby process privileges, exploit requires crafted image path with shell metacharacters."
url: https://panop.io/threat-heartbeat/CVE-2026-107704/
---

# CVE-2026-107704 image\_optimizer Ruby gem - Command Injection

image\_optimizer Ruby gem 1.3.0 through 1.9.0 contains a command injection caused by improper sanitization of image path in ImageOptimizer#identify\_format, letting attackers execute OS commands with Ruby process privileges, exploit requires crafted image path with shell metacharacters.

CVSS base score 9.8 /10

Critical

CISA KEV

Not listed

Public exploit

None known

Authentication

Not required

EPSS

1.66% chance of exploitation in 30 days

[View the NVD record ↗](https://nvd.nist.gov/vuln/detail/CVE-2026-107704)

## Details

Type

Command Injection

Impact

Remote Code Execution

CVSS vector

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Published

8 October 2026

Updated

15 October 2026

Weakness

[CWE-78](https://cwe.mitre.org/data/definitions/78.html)

## Vendor fix

Update to a version later than 1.9.0 or the latest available version.

Patching closes this CVE. It does not tell you which of your systems run the affected version, or what else is exposed alongside them.

## References

- [https://nvd.nist.gov/vuln/detail/CVE-2026-107704](https://nvd.nist.gov/vuln/detail/CVE-2026-107704)
- [https://github.com/jtescher/image\_optimizer](https://github.com/jtescher/image_optimizer)
- [https://github.com/jtescher/image\_optimizer/blob/v1.9.0/lib/image\_optimizer.rb#L37-L47](https://github.com/jtescher/image_optimizer/blob/v1.9.0/lib/image_optimizer.rb#L37-L47)
- [https://github.com/jtescher/image\_optimizer/blob/v1.9.0/lib/image\_optimizer/shell.rb#L30-L32](https://github.com/jtescher/image_optimizer/blob/v1.9.0/lib/image_optimizer/shell.rb#L30-L32)
- [https://www.vulncheck.com/advisories/image-optimizer-1.3.0-through-1.9.0-os-command-injection-via-identify-format](https://www.vulncheck.com/advisories/image-optimizer-1.3.0-through-1.9.0-os-command-injection-via-identify-format)
- [https://gist.github.com/R3tro16/a99a058d24a06692721a6a3fade9649d](https://gist.github.com/R3tro16/a99a058d24a06692721a6a3fade9649d)

[← All CVEs](https://panop.io/threat-heartbeat/)

## What this record can't tell you

- Whether you run the affected software, and where
- Whether an attacker can actually reach and exploit it
- The misconfigurations that never get a CVE number
- What it would cost the business, ranked into what to fix first

Panop answers these inside your environment, for this CVE and every other finding.

[Book a demo](https://panop.io/demo)
