{"id":"CVE-2023-45666","aliases":["CVE-2023-45666"],"related":[],"kind":"vulnerability","state":"published","title":"Possible double-free or memory leak in stbi__load_gif_main in stb_image","summary":"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","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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","source":"cvelist"},{"lang":"es","text":"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.","source":"nvd"}],"published":"2023-10-20T23:26:42.620Z","modified":"2026-06-17T06:29:18.627Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L","score":7.3,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L","score":7.3,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"}],"cwes":["CWE-415"],"affected":[{"ranges":[{"version":"<= 2.28","status":"affected"}],"vendor":"nothings","product":"stb","source":"cvelist"},{"ranges":[{"type":"custom","introduced":"0","lastAffected":"2.28","status":"affected"}],"vendor":"nothings","product":"stb_image","cpe":"cpe:2.3:a:nothings:stb_image:*:*:*:*:*:*:*:*","source":"cvelist"},{"ranges":[{"status":"affected","version":"2.28"}],"vendor":"nothings","product":"stb_image.h","cpe":"cpe:2.3:a:nothings:stb_image.h:2.28:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://securitylab.github.com/advisories/GHSL-2023-145_GHSL-2023-151_stb_image_h/","tags":["third-party-advisory","x-refsource-confirm","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://github.com/nothings/stb/blob/5736b15f7ea0ffb08dd38af21067c314d6a3aae9/stb_image.h#L6957","tags":["third-party-advisory","x-refsource-misc","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://github.com/nothings/stb/blob/5736b15f7ea0ffb08dd38af21067c314d6a3aae9/stb_image.h#L6962-L7045","tags":["third-party-advisory","x-refsource-misc","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/UVQ7ONFH5GWLMXYEAJG32A3EUKUCEVCR/","tags":["x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/QVABVF4GEM6BYD5L4L64RCRSXUHY6LGN/","tags":["x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/NMXKOKPP4BKTNUTF5KSRDQAWOUILQZNO/","tags":["x-transferred"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"partial","date":"2024-09-12T14:07:55.124Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2023-45666","url":"https://www.cve.org/CVERecord?id=CVE-2023-45666","licence":"CVE Terms of Use","modified":"2025-02-13T17:14:06.442Z"},{"source":"nvd","name":"NVD","id":"CVE-2023-45666","url":"https://nvd.nist.gov/vuln/detail/CVE-2023-45666","licence":"Public domain","modified":"2026-06-17T06:29:18.627Z"}],"updatedAt":"2026-11-25T22:58:28.995Z","epss":{"score":0.01071,"percentile":0.65815,"date":"2026-12-01T12:00:22.000Z"}}