/

CVE-2026-52490

Severity:

CRITICAL RISK

(9.8)

Code Injection (CWE-94) in libtiff tiffcrop Utility

CVE-2026-52490

Awaiting Analysis

Vulnerability type

Category:

Code Injection

CWE:

CWE-94

Impact:

Arbitrary Code Execution

Severity:

CRITICAL RISK

(9.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A critical code-injection vulnerability in libtiff may allow arbitrary code execution through the process_command_opts() function in the tiffcrop utility. The risk arises when attacker-controlled command or option data is processed without adequately restricting what can be interpreted as executable behavior.

Affected context

The vulnerability occurs in libtiff's tiffcrop command-line processing path, specifically around process_command_opts() in tools/tiffcrop.c. Deployments become exposed when untrusted users, services, scripts, or remotely supplied data can cause tiffcrop to process attacker-controlled options or inputs. Actual exposure depends on how the utility is invoked and what privileges its process receives.

Exploit preconditions

  • Attack surface: The tiffcrop command-option processing interface - Required access: Ability to cause tiffcrop to process attacker-controlled

command or option data

  • Trigger point: Processing performed by process_command_opts() - Why exploitation is possible: Insufficient separation between data

supplied as options and behavior treated as executable code may allow crafted

input to influence code execution

Why this happens

The underlying bug is an unsafe command or option processing pattern in which externally influenced input can reach behavior capable of generating or executing code. This maps to CWE-94: Improper Control of Generation of Code, where input is not sufficiently constrained before it affects dynamic code-related operations. The issue is distinct from ordinary parsing errors because the affected input may alter program behavior beyond its intended data-processing role.

Potential impact

  • An attacker could execute arbitrary code with the privileges of the tiffcrop process.
  • A compromised process may expose, alter, or delete accessible files.
  • The vulnerability could enable further compromise of the host or surrounding services.
  • In automated image-processing workflows, an attacker may disrupt processing or tamper with generated output.

General mitigation guidance

Mitigation generally focuses on ensuring that command-line options and other external inputs remain data rather than executable instructions. Secure patterns include using fixed argument mappings, strict allowlists for accepted options and values, rejecting unexpected syntax, and avoiding dynamic evaluation or shell interpretation. Input trust should be reduced at every boundary, and tiffcrop-like processing should run with least privilege, restricted filesystem access, and suitable process isolation. Defensive controls should also limit which identities and services can invoke the utility with untrusted data.

How teams detect issues like this

Detection can include static analysis for dynamic evaluation, shell invocation, unsafe string-to-code conversions, and option handlers that pass untrusted values into executable contexts. Code reviews should examine process_command_opts() and similar parsing functions for missing allowlists, ambiguous option boundaries, and implicit command interpretation. Runtime monitoring can flag unusual child-process creation, unexpected command execution, or tiffcrop activity against untrusted inputs. CI policies and automated security review tools can enforce safe argument-handling patterns.

Sources

SourceLink
gist.github.comgist.github.com/okyfh/122c2d72e991a78c8af80a3af3be8671
gitlab.comgitlab.com/libtiff/libtiff/-/work_items/846

Frequently asked

questions

Potentially, if a network-facing or automated service invokes tiffcrop with

attacker-controlled options or input. Otherwise, exploitation may require

local access or control over a processing workflow.

The required access depends on the deployment. An attacker must be able to

influence data or options that reach the vulnerable command-processing path;

that capability may be available through an authenticated service, an

untrusted upload workflow, or local execution.

Treat all command options and related input as untrusted data, permit only

explicitly supported values, and remove dynamic evaluation or shell-based

interpretation from the processing path.

Use strict argument schemas and allowlists, test malformed and adversarial

options, run image-processing utilities with minimal privileges, and enforce

static-analysis and code-review policies for dynamic command construction.

Find out what's already
exploitable in your codebase.