Severity by source
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
AV:N and PR:N reflect worst-case unauthenticated network exposure of the crop endpoint; A:H reflects guaranteed process crash; C:N and I:N because the flaw yields no data exposure or data modification.
Primary rating from Vendor (TuranSec).
CVSS VectorVendor: TuranSec
Lifecycle Timeline
2DescriptionCVE.org
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.
AnalysisAI
Integer underflow in the raster Rust crate's crop() function enables remote process crash via a single crafted request. When offset_x or offset_y exceeds the source image dimension, the signed subtraction wraps to a large negative i32 in release builds; that value is then cast to usize and passed to Vec::with_capacity(), triggering an unrecoverable capacity-overflow panic that kills the host process. No active exploitation is confirmed (not in CISA KEV) and no public POC is listed, but the AV:N/AC:L/PR:N/UI:N CVSS vector indicates zero-friction denial-of-service for any application that exposes the crop() call to untrusted input.
Technical ContextAI
The raster crate (CPE: cpe:2.3:a:kosinix:raster:*:*:*:*:*:*:*:*) is a Rust image-processing library authored by kosinix. The flaw lives in src/editor.rs inside the crop() function, which clamps the requested crop width and height against source dimensions but applies no upper-bound check to offset_x or offset_y - only a lower-bound clamp against zero. When an attacker supplies an offset beyond the image edge, the subtraction width2 - offset_x (performed as signed i32) wraps in Rust release builds (release mode uses wrapping two's-complement arithmetic rather than the overflow panic of debug mode), producing a large negative integer. That value is subsequently cast to usize - a widening reinterpretation that yields an astronomically large allocation size - and forwarded to Vec::with_capacity() inside Image::blank(). The allocator rejects the impossible capacity, Rust panics, and the OS terminates the process. CWE-191 (Integer Underflow / Wrap-or-Wraparound) precisely describes this root cause: an arithmetic operation produces a result below the minimum representable value of the type, and the wraparound is later interpreted in a type context where it causes catastrophic downstream behaviour.
RemediationAI
No vendor-released patch has been identified at time of analysis; the only available reference is the GitHub issue at https://github.com/kosinix/raster/issues/30, which should be monitored for an upstream fix or tagged release. Until a patch is available, the most effective compensating control is to validate offset_x and offset_y at the application boundary before calling crop(), explicitly rejecting any offset value that equals or exceeds the corresponding source image dimension (offset_x must be strictly less than source width; offset_y strictly less than source height) - this prevents the underflowing subtraction entirely. Alternatively, applications that cannot immediately apply input validation should restrict the crop() endpoint to authenticated or internally-trusted callers only, removing the network-accessible unauthenticated attack surface the CVSS AV:N vector assumes. For new projects or those with flexibility to migrate, replacing the raster dependency with a maintained crate such as the image crate is advisable; the trade-off is a migration effort proportional to API surface used.
Same weakness CWE-191 – Integer Underflow
View allSame technique Denial Of Service
View allVendor StatusVendor
Share
External POC / Exploit Code
Leaving vuln.today
EUVD-2026-53199
GHSA-hjwh-6x9j-wjwq