Severity:

CRITICAL RISK

(9.8)

Improper Input Validation in MolotovCherry

CVE-2026-4755

Analyzed

Vulnerability type

Category:

Improper Input Validation

CWE:

CWE-20

Impact:

Potential Memory Corruption, Denial of Service, and Data Integrity Violations

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 improper input validation flaw in MolotovCherry Android-ImageMagick7, affecting versions before 7.1.2-11, allows crafted image or data inputs to be processed without sufficient sanity checks.

When untrusted content is passed into Android-ImageMagick7, this lack of validation can cascade into severe downstream issues such as memory corruption, denial of service, or other follow‑on vulnerabilities in consuming applications.

Affected context

The vulnerability arises in applications that embed or rely on MolotovCherry Android-ImageMagick7 for image processing tasks, particularly when handling content originating from untrusted or user-controlled sources.

Typical contexts include mobile apps that accept uploaded images, process media received over the network, or transform images obtained from third-party services without enforcing strict validation or format constraints before passing them into the library.

Exploit preconditions

  • Attack surface: Any feature or API that routes externally supplied images or related data into Android-ImageMagick7 for decoding, transformation, or analysis.
  • Required access: Ability to supply or influence input processed by the library (e.g., file upload, message attachment, remote image URL ingestion).
  • Trigger point: Invocation of vulnerable image processing routines on a crafted payload, such as decoding, resizing, converting, or otherwise manipulating the image.
  • Why exploitation is possible: The library does not adequately validate or sanitize key aspects of the input (e.g., structure, size, metadata fields, or internal offsets), allowing malformed or extreme values to pass through and stress assumptions in lower-level processing code.

Why this happens

This issue maps to CWE-20: Improper Input Validation, where the application or library accepts input without verifying that it conforms to expected formats, ranges, and structural invariants.

In the context of an image-processing engine, failing to validate headers, dimensions, color depths, metadata lengths, or embedded resource references can cause the underlying code to operate on unexpected values.

Such unsafe assumptions often lead to out-of-bounds accesses, excessive resource consumption, or other undefined behaviors, especially when complex parsers and native-image codecs are involved.

Potential impact

  • Application or service crashes when processing maliciously crafted images (denial of service).
  • Potential memory corruption if invalid structures or sizes are trusted by lower-level codecs.
  • Data integrity issues, such as incorrect transformations or corrupted outputs.
  • In extreme cases, possible stepping stone towards code execution if paired with additional weaknesses in native components.
  • Abuse of resource-intensive operations (e.g., huge dimensions) to consume CPU, memory, or storage.

General mitigation guidance

Effective mitigation focuses on enforcing strict validation and limiting trust in external content before it reaches Android-ImageMagick7, as well as constraining what the library is allowed to do:

  • Validate input early: Enforce file type filtering, size limits, and basic structural checks before invoking the library.
  • Apply conservative resource limits: Restrict maximum image dimensions, frame counts, color depths, and processing time to prevent excessive resource usage.
  • Fail closed on parsing anomalies: Treat parsing errors, unexpected metadata, or inconsistent headers as hard failures rather than attempting to continue processing.
  • Isolate risky processing: Run heavyweight or untrusted image processing in a constrained environment (sandboxed process, reduced privileges, and limited permissions).
  • Prefer secure-by-default configurations: Disable rarely used or high-risk formats, features, or codecs unless strictly required by the application's use case.

How teams detect issues like this

Organizations can adopt a mix of code-centric and behavior-centric detection strategies:

  • Static analysis and code review: Look for code paths that pass untrusted image data directly to Android-ImageMagick7 without prior validation, range checking, or resource limiting.
  • Configuration auditing: Review how the library is configured (e.g., allowed formats, limits) and flag permissive or unrestricted settings for further tightening.
  • Runtime monitoring: Instrument services to detect crashes, abnormal memory growth, or CPU spikes correlated with image processing operations and inspect the associated inputs.
  • Policy enforcement in CI/CD: Use automated review tools to ensure all media-handling endpoints apply whitelisting, size checks, and format validation before calling into image-processing libraries.

Sources

SourceLink
github.comgithub.com/MolotovCherry/Android-ImageMagick7/pull/193

Frequently asked

questions

Exploitability depends on how the application exposes Android-ImageMagick7. If any unauthenticated or low-privileged user can supply images that get processed by the library, the exposure is broad; tightly controlled internal use reduces, but does not eliminate, risk.

Not necessarily. The primary requirement is the ability to influence or supply content that the application routes into Android-ImageMagick7. Public upload endpoints or messaging features often provide sufficient access, even for anonymous users.

Apply strict, centralized input validation and resource limiting for all image-processing paths, and configure the library in a conservative, least-feature mode. Ensure that malformed or unexpected inputs cause the processing to fail fast rather than attempting to recover.

Design image-handling features around a "zero trust" model for external media: enforce format whitelists, size and dimension caps, robust header validation, and sandboxed processing by default. Incorporate secure coding guidelines and automated checks for media parsing into development and review workflows.

Find out what's already
exploitable in your codebase.