The raster Rust crate's crop() function (src/editor.rs)...
High severity
Unreviewed
Published
Aug 5, 2026
to the GitHub Advisory Database
•
Updated Aug 5, 2026
Description
Published by the National Vulnerability Database
Aug 5, 2026
Published to the GitHub Advisory Database
Aug 5, 2026
Last updated
Aug 5, 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.References