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 package | Versions | Reported by |
|---|---|---|
| nothings stb | <= 2.28 | CVE List |
| nothings stb_image | up to 2.28 | CVE List |
| nothings stb_image.h | 2.28 | NVD |
All scores
| GitHub_M | 6.5medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:L |
| NVD | 8.1high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:H |
Classification
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
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2023-45662 changed 2025-02-13 | CVE Terms of Use |
| NVD | CVE-2023-45662 changed 2026-06-17 | Public domain |