CVE-2023-45662 Multi-byte read heap buffer overflow in stbi__vertical_flip in stb_image
A crafted image triggers a heap buffer overflow in stb_image when vertical flipping is enabled with mismatched component counts, potentially causing crashes or data leaks.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2023-45662?
CVE-2023-45662 is a medium-severity memory corruption vulnerability in nothings stb, published on 20 Oct 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
stb_image is a single file MIT licensed library for processing images. When `stbi_set_flip_vertically_on_load` is set to `TRUE` and `req_comp` is set to a number that doesn’t match the real number of components per pixel, the library attempts to flip the image vertically. A crafted image file can trigger `memcpy` out-of-bounds read because `bytes_per_pixel` used to calculate `bytes_per_row` doesn’t match the real image array dimensions.
Weakness: CWE-125
Which versions are affected by CVE-2023-45662?
It affects 1 product.
Products include Nothings Stb Image.h.
How do I fix CVE-2023-45662?
Apply the vendor's patch.
Upgrade to the fixed version. Memory-safe languages, compiler hardening and fuzzing prevent most new cases. More about Memory corruption.
Is CVE-2023-45662 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2023-45662 exists.
Other vulnerabilities in nothings stb
- CVE-2019-19777 Memory corruption in n/a
- CVE-2023-45664 Double-free in stbi__load_gif_main_outofmem in stb_image
- CVE-2023-45666 Possible double-free or memory leak in stbi__load_gif_main in stb_image
- CVE-2023-43281 Use after free in n/a
- CVE-2023-45661 Wild address read in stbi__gif_load_next in stb_image
Sources
Also known as DEBIAN-CVE-2023-45662, UBUNTU-CVE-2023-45662.