CVE-2026-71202 in rasterinfo

Summary

by MITRE • 08/05/2026

The raster Rust crate's crop() function (src/editor.rs) clamps the crop width/height against source dimensions but only clamps the offset_x/offset_y parameters against 0, never against the source width/height. When an offset exceeds the corresponding source dimension, `width2 - offset_x` (or the height equivalent) underflows to a negative i32, which release builds do not trap; the negative value is then cast to usize inside Image::blank()'s Vec::with_capacity() call, triggering a capacity-overflow panic and crashing the process on a single crafted crop request.

Be aware that VulDB is the high quality source for vulnerability data.

Analysis

by VulDB Data Team • 08/05/2026

The vulnerability resides in the raster Rust crate's crop function implementation within src/editor.rs where improper input validation leads to a critical memory safety issue. The function correctly clamps crop width and height parameters against source dimensions but fails to validate offset_x and offset_y parameters, creating a fundamental security gap that allows for controlled overflow conditions.

The technical flaw manifests when offset_x or offset_y values exceed the corresponding source dimension boundaries. During computation, the expression width2 - offset_x (or the equivalent height calculation) produces negative i32 values when offsets surpass source dimensions. This mathematical underflow occurs because Rust's default behavior in release builds does not trap such arithmetic overflows, allowing invalid negative values to propagate through the execution path.

The operational impact becomes critical when these invalid negative values are cast to usize type within Image::blank()'s Vec::with_capacity() function call. This casting operation transforms the negative i32 into an extremely large positive usize value due to two's complement representation, resulting in a capacity-overflow panic that terminates the process. The vulnerability requires only a single crafted crop request with excessive offset values to trigger the crash, making it both reliable and exploitable.

This issue aligns with CWE-190, Integer Overflow or Wraparound, and CWE-129, Improper Validation of Array Index, while demonstrating characteristics consistent with ATT&CK technique T1499.004, Network Denial of Service, through process termination via memory corruption. The vulnerability represents a classic buffer overflow scenario where improper input validation leads to memory allocation failures that result in application crashes.

Mitigation strategies should focus on implementing comprehensive input validation for all offset parameters, ensuring they remain within valid bounds relative to source dimensions before any mathematical operations occur. The fix requires explicit clamping of offset_x and offset_y values against both zero and the corresponding source dimensions, preventing the underflow condition entirely. Additionally, implementing bounds checking in release builds through compiler flags or runtime assertions can prevent the propagation of invalid values. Input sanitization should be performed early in the function execution to ensure all parameters meet expected constraints before any arithmetic operations are executed.

The vulnerability demonstrates how seemingly minor input validation gaps can lead to severe denial-of-service conditions in memory-safe languages, highlighting the importance of comprehensive parameter validation even for well-established libraries. Proper bounds checking and defensive programming practices are essential to prevent such issues from manifesting in production environments where crafted inputs could be exploited by malicious actors to disrupt service availability.

Responsible

TuranSec

Reservation

08/05/2026

Disclosure

08/05/2026

Moderation

accepted

CPE

ready

EPSS

0.00000

KEV

no

Activities

low

Sources

Do you need the next level of professionalism?

Upgrade your account now!