Executive brief
embedded-graphics is a Rust graphics library used for drawing on embedded systems and displays. A bounds-checking flaw in the ImageRaw::draw_sub_image method allows an attacker to bypass safety checks through integer overflow, potentially causing the application to hang, crash, or read unintended memory contents when rendering an image.
Technical details
The vulnerability is an integer overflow (CWE-190) in the bounds-checking logic at src/image/image_raw.rs lines 227–228. The bounds check uses wrapping arithmetic in Rust release mode, allowing an attacker to craft a Rectangle parameter where (top_left.x as u32 + size.width) overflows the u32 type and wraps to a value that passes the check despite exceeding actual image boundaries. Once bypassed, the attacker-controlled width is used to construct a ContiguousPixels iterator that performs excessive iterations, leading to denial of service or out-of-bounds memory reads. The attack is network-reachable if the affected application exposes image rendering over a network protocol. No patch has been released as of the advisory date; the project maintainers have not responded to the early disclosure.
Affected products
- embedded-graphics embedded-graphics up to 0.8.2
Timeline
- 2026-09-13: disclosed
- 2026-08-03: other: Issue #821 opened on GitHub