// For flags

CVE-2023-45666

Possible double-free or memory leak in stbi__load_gif_main in stb_image

Severity Score

9.8
*CVSS v3.1

Exploit Likelihood

*EPSS

Affected Versions

*CPE

Public Exploits

0
*Multiple Sources

Exploited in Wild

-
*KEV

Decision

Attend
*SSVC
Descriptions

stb_image is a single file MIT licensed library for processing images. It may look like `stbi__load_gif_main` doesn’t give guarantees about the content of output value `*delays` upon failure. Although it sets `*delays` to zero at the beginning, it doesn’t do it in case the image is not recognized as GIF and a call to `stbi__load_gif_main_outofmem` only frees possibly allocated memory in `*delays` without resetting it to zero. Thus it would be fair to say the caller of `stbi__load_gif_main` is responsible to free the allocated memory in `*delays` only if `stbi__load_gif_main` returns a non null value. However at the same time the function may return null value, but fail to free the memory in `*delays` if internally `stbi__convert_format` is called and fails. Thus the issue may lead to a memory leak if the caller chooses to free `delays` only when `stbi__load_gif_main` didn’t fail or to a double-free if the `delays` is always freed

stb_image es una librería con licencia MIT de un solo archivo para procesar imágenes. Puede parecer que `stbi__load_gif_main` no ofrece garantías sobre el contenido del valor de salida `*delays` en caso de falla. Aunque establece `*delays` en cero al principio, no lo hace en caso de que la imagen no se reconozca como GIF y una llamada a `stbi__load_gif_main_outofmem` solo libera la memoria posiblemente asignada en `*delays` sin restablecerla a cero. Por lo tanto, sería justo decir que la persona que llama a `stbi__load_gif_main` es responsable de liberar la memoria asignada en `*delays` solo si `stbi__load_gif_main` devuelve un valor no nulo. Sin embargo, al mismo tiempo, la función puede devolver un valor nulo, pero no puede liberar la memoria en `*delays` si internamente se llama a `stbi__convert_format` y falla. Por lo tanto, el problema puede provocar una pérdida de memoria si la persona que llama elige liberar los "delays" solo cuando "stbi__load_gif_main" no falló o una doble liberación si los "delays" siempre se liberan.

*Credits: N/A
CVSS Scores
Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High
Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
Low
Availability
Low
* Common Vulnerability Scoring System
SSVC
  • Decision:Attend
Exploitation
Poc
Automatable
Yes
Tech. Impact
Partial
* Organization's Worst-case Scenario
Timeline
  • 2023-10-10 CVE Reserved
  • 2023-10-20 CVE Published
  • 2024-09-12 CVE Updated
  • 2024-10-26 EPSS Updated
  • ---------- Exploited in Wild
  • ---------- KEV Due Date
  • ---------- First Exploit
CWE
  • CWE-415: Double Free
CAPEC
Affected Vendors, Products, and Versions
Vendor Product Version Other Status
Vendor Product Version Other Status <-- --> Vendor Product Version Other Status
Nothings
Search vendor "Nothings"
Stb Image.h
Search vendor "Nothings" for product "Stb Image.h"
2.28
Search vendor "Nothings" for product "Stb Image.h" and version "2.28"
-
Affected