CVE-2023-45662
JSON

6.5medium

Multi-byte read heap buffer overflow in stbi__vertical_flip in stb_image

Severity
6.5medium CVSS:3.1 by GitHub_M
Exploit likelihood
0.81% (higher than 57% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M

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.

Affected

Product or packageVersionsReported by
nothings stb<= 2.28CVE List
nothings stb_imageup to 2.28CVE List
nothings stb_image.h2.28NVD

All scores

GitHub_M6.5medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:L
NVD8.1high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:H

Classification

CWE-125

SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact partial.

What each source says

CVE List

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.

NVD (es)

stb_image es una librería con licencia MIT de un solo archivo para procesar imágenes. Cuando `stbi_set_flip_vertically_on_load` se establece en `TRUE` y `req_comp` se establece en un número que no coincide con el número real de componentes por píxel, la librería intenta voltear la imagen verticalmente. Un archivo de imagen manipulado puede provocar una lectura fuera de límites de `memcpy` porque los `bytes_per_pixel` utilizados para calcular `bytes_per_row` no coinciden con las dimensiones reales de la matriz de imágenes.

References

Sources

SourceRecordLicence
CVE ListCVE-2023-45662 changed 2025-02-13CVE Terms of Use
NVDCVE-2023-45662 changed 2026-06-17Public domain