CVE-2026-71202 PUBLISHED

raster: Integer Underflow in crop() Offset Handling Causes Capacity-Overflow Panic

Assigner: TuranSec
Reserved: 05.08.2026 Published: 05.08.2026 Updated: 05.08.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.

Metrics

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

Product Status

Vendor kosinix
Product raster
Versions Default: unknown
  • affected from 0 to 0.2.1 (incl.)

Credits

  • agrresore finder

References

Problem Types

  • CWE-191 Integer Underflow CWE