{"id":"CVE-2023-45667","aliases":["ALPINE-CVE-2023-45667","DEBIAN-CVE-2023-45667","EUVD-2023-49958","OESA-2024-1262","OESA-2024-1263","UBUNTU-CVE-2023-45667"],"status":"published","title":"Null pointer dereference because of an uninitialized variable in stb_image","description":"stb_image is a single file MIT licensed library for processing images.\n\nIf `stbi__load_gif_main` in `stbi_load_gif_from_memory` fails it returns a null pointer and may keep the `z` variable uninitialized. In case the caller also sets the flip vertically flag, it continues and calls `stbi__vertical_flip_slices` with the null pointer result value and the uninitialized `z` value. This may result in a program crash.","severity":{"version":"3.1","score":5.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","level":"medium","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-11","score":0.01269,"percentile":0.70171,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-476"],"published":"2023-10-20T23:26:44Z","modified":"2026-11-03T06:32:43Z","fixes":[{"ecosystem":"Alpine:v3.19","package":"stb","fixed_in":["0_git20231012-r0"],"sources":["osv"]},{"ecosystem":"Alpine:v3.20","package":"stb","fixed_in":["0_git20231012-r0"],"sources":["osv"]},{"ecosystem":"Alpine:v3.21","package":"stb","fixed_in":["0_git20231012-r0"],"sources":["osv"]},{"ecosystem":"Alpine:v3.22","package":"stb","fixed_in":["0_git20231012-r0"],"sources":["osv"]},{"ecosystem":"Alpine:v3.23","package":"stb","fixed_in":["0_git20231012-r0"],"sources":["osv"]},{"ecosystem":"Alpine:v3.24","package":"stb","fixed_in":["0_git20231012-r0"],"sources":["osv"]}],"affected":[{"source":"osv","ecosystem":"Alpine:v3.19","package":"stb","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0_git20231012-r0"}]}]},{"source":"osv","ecosystem":"Alpine:v3.20","package":"stb","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0_git20231012-r0"}]}]},{"source":"osv","ecosystem":"Alpine:v3.21","package":"stb","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0_git20231012-r0"}]}]},{"source":"osv","ecosystem":"Alpine:v3.22","package":"stb","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0_git20231012-r0"}]}]},{"source":"osv","ecosystem":"Alpine:v3.23","package":"stb","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0_git20231012-r0"}]}]},{"source":"osv","ecosystem":"Alpine:v3.24","package":"stb","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0_git20231012-r0"}]}]},{"source":"osv","ecosystem":"Debian:12","package":"libstb","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.0~git20220908.8b5f1f3+ds-1","0.0~git20230129.5736b15+ds-1","0.0~git20230129.5736b15+ds-1.1","0.0~git20230129.5736b15+ds-1.1~exp1","0.0~git20230129.5736b15+ds-1.2","0.0~git20240715.f7f20f39fe4f+ds-1","0.0~git20241109.5c20573+ds-1","0.0~git20250907.fede005+ds-1"]},{"source":"osv","ecosystem":"Debian:13","package":"libstb","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.0~git20241109.5c20573+ds-1","0.0~git20250907.fede005+ds-1"]},{"source":"osv","ecosystem":"Debian:14","package":"libstb","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.0~git20241109.5c20573+ds-1","0.0~git20250907.fede005+ds-1"]},{"source":"osv","ecosystem":"openEuler:22.03-LTS-SP3","package":"stb","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.20220908git8b5f1f3-0.12.oe2203sp3"}]}],"bundled":2},{"source":"osv","ecosystem":"openEuler:22.03-LTS-SP2","package":"stb","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.20220908git8b5f1f3-0.12.oe2203sp2"}]}],"bundled":2},{"source":"osv","ecosystem":"Ubuntu:20.04:LTS","package":"libstb","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.0~git20190817.1.052dce1-1"]},{"source":"osv","ecosystem":"Ubuntu:22.04:LTS","package":"libstb","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.0~git20200713.b42009b+ds-1","0.0~git20210910.af1a5bc+ds-1"]},{"source":"osv","ecosystem":"Ubuntu:24.04:LTS","package":"libstb","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.0~git20230129.5736b15+ds-1","0.0~git20230129.5736b15+ds-1.1","0.0~git20230129.5736b15+ds-1.2"]},{"source":"osv","ecosystem":"Ubuntu:25.10","package":"libstb","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.0~git20240715.f7f20f39fe4f+ds-1","0.0~git20241109.5c20573+ds-1"]},{"source":"osv","ecosystem":"Ubuntu:26.10","package":"libstb","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.0~git20250907.fede005+ds-1"]},{"source":"osv","ecosystem":"Ubuntu:26.04:LTS","package":"libstb","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["0.0~git20241109.5c20573+ds-1","0.0~git20250907.fede005+ds-1"]}],"products":[{"vendor":"nothings","product":"stb"},{"vendor":"nothings","product":"stb_image"},{"vendor":"nothings","product":"stb_image.h"}],"references":[{"url":"https://securitylab.github.com/advisories/GHSL-2023-145_GHSL-2023-151_stb_image_h/","tags":["x_refsource_CONFIRM","x_transferred","Third Party Advisory","advisory","report"]},{"url":"https://github.com/nothings/stb/blob/5736b15f7ea0ffb08dd38af21067c314d6a3aae9/stb_image.h#L1442-L1454","tags":["x_refsource_MISC","x_transferred","Third Party Advisory","web","report"]},{"url":"https://github.com/nothings/stb/blob/5736b15f7ea0ffb08dd38af21067c314d6a3aae9/stb_image.h#L1448","tags":["x_refsource_MISC","x_transferred","Third Party Advisory","web","report"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/UVQ7ONFH5GWLMXYEAJG32A3EUKUCEVCR/","tags":["x_transferred","web"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/QVABVF4GEM6BYD5L4L64RCRSXUHY6LGN/","tags":["x_transferred","web"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/NMXKOKPP4BKTNUTF5KSRDQAWOUILQZNO/","tags":["x_transferred","web"]},{"url":"https://security.alpinelinux.org/vuln/CVE-2023-45667","tags":["advisory"]},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/45xxx/CVE-2023-45667.json","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2023-45667","tags":["advisory"]},{"url":"https://security-tracker.debian.org/tracker/CVE-2023-45667","tags":["advisory"]},{"url":"https://www.openeuler.org/en/security/safety-bulletin/detail.html?id=openEuler-SA-2024-1262","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2023-45666","tags":["advisory"]},{"url":"https://www.openeuler.org/en/security/safety-bulletin/detail.html?id=openEuler-SA-2024-1263","tags":["advisory"]},{"url":"https://ubuntu.com/security/CVE-2023-45667","tags":["report"]},{"url":"https://www.cve.org/CVERecord?id=CVE-2023-45667","tags":["report"]}],"sources":{"cve":[{"id":"CVE-2023-45667","title":"Null pointer dereference because of an uninitialized variable in stb_image","description":"stb_image is a single file MIT licensed library for processing images.\n\nIf `stbi__load_gif_main` in `stbi_load_gif_from_memory` fails it returns a null pointer and may keep the `z` variable uninitialized. In case the caller also sets the flip vertically flag, it continues and calls `stbi__vertical_flip_slices` with the null pointer result value and the uninitialized `z` value. This may result in a program crash.","status":"published","published":"2023-10-20T23:26:44.376Z","modified":"2025-02-13T17:14:07.042Z","cvss":[{"version":"3.1","score":5.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","level":"medium","assessor":"cna"}],"cwes":["CWE-476"],"updated_at":"2026-11-02T14:35:22.640346Z"}],"euvd":[{"id":"EUVD-2023-49958","description":"stb_image is a single file MIT licensed library for processing images.\n\nIf `stbi__load_gif_main` in `stbi_load_gif_from_memory` fails it returns a null pointer and may keep the `z` variable uninitialized. In case the caller also sets the flip vertically flag, it continues and calls `stbi__vertical_flip_slices` with the null pointer result value and the uninitialized `z` value. This may result in a program crash.","status":"published","published":"2023-10-20T23:26:44Z","modified":"2025-02-13T17:14:07Z","cvss":[{"version":"3.1","score":5.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","level":"medium"}],"updated_at":"2026-11-03T00:03:48.562419Z"}],"nvd":[{"id":"CVE-2023-45667","description":"stb_image is a single file MIT licensed library for processing images.\n\nIf `stbi__load_gif_main` in `stbi_load_gif_from_memory` fails it returns a null pointer and may keep the `z` variable uninitialized. In case the caller also sets the flip vertically flag, it continues and calls `stbi__vertical_flip_slices` with the null pointer result value and the uninitialized `z` value. This may result in a program crash.","status":"published","published":"2023-10-21T00:15:09.143Z","modified":"2026-06-17T06:29:19.47Z","cvss":[{"version":"3.1","score":5.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","level":"medium","assessor":"secondary"},{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high","assessor":"primary"}],"cwes":["CWE-476"],"updated_at":"2026-11-02T14:08:39.058878Z"}],"osv":[{"id":"ALPINE-CVE-2023-45667","description":"stb_image is a single file MIT licensed library for processing images.\n\nIf `stbi__load_gif_main` in `stbi_load_gif_from_memory` fails it returns a null pointer and may keep the `z` variable uninitialized. In case the caller also sets the flip vertically flag, it continues and calls `stbi__vertical_flip_slices` with the null pointer result value and the uninitialized `z` value. This may result in a program crash.","status":"published","published":"2023-10-21T00:15:09.143Z","modified":"2026-11-03T06:32:43.527222368Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high"}],"updated_at":"2026-11-03T07:17:02.90744Z"},{"id":"CVE-2023-45667","title":"Null pointer dereference because of an uninitialized variable in stb_image","description":"stb_image is a single file MIT licensed library for processing images.\n\nIf `stbi__load_gif_main` in `stbi_load_gif_from_memory` fails it returns a null pointer and may keep the `z` variable uninitialized. In case the caller also sets the flip vertically flag, it continues and calls `stbi__vertical_flip_slices` with the null pointer result value and the uninitialized `z` value. This may result in a program crash.","status":"published","published":"2023-10-20T23:26:44.376Z","modified":"2026-03-14T12:20:50.511024Z","cvss":[{"version":"3.1","score":5.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","level":"medium"}],"cwes":["CWE-476"],"updated_at":"2026-11-02T15:44:34.287121Z"},{"id":"DEBIAN-CVE-2023-45667","description":"stb_image is a single file MIT licensed library for processing images.  If `stbi__load_gif_main` in `stbi_load_gif_from_memory` fails it returns a null pointer and may keep the `z` variable uninitialized. In case the caller also sets the flip vertically flag, it continues and calls `stbi__vertical_flip_slices` with the null pointer result value and the uninitialized `z` value. This may result in a program crash.","status":"published","published":"2023-10-21T00:15:09.143Z","modified":"2026-10-26T18:03:06.608567857Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high"}],"updated_at":"2026-11-02T15:45:40.275853Z"},{"id":"OESA-2024-1262","title":"stb security update","description":"Single-file public domain libraries for C/C++.\r\n\r\nSecurity Fix(es):\r\n\r\nstb_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(CVE-2023-45666)\r\n\r\nstb_image is a single file MIT licensed library for processing images.\r\n\r\nIf `stbi__load_gif_main` in `stbi_load_gif_from_memory` fails it returns a null pointer and may keep the `z` variable uninitialized. In case the caller also sets the flip vertically flag, it continues and calls `stbi__vertical_flip_slices` with the null pointer result value and the uninitialized `z` value. This may result in a program crash.(CVE-2023-45667)","status":"published","published":"2024-03-08T11:06:42Z","modified":"2026-08-18T01:18:18.42021005Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"updated_at":"2026-11-02T15:52:40.71472Z"},{"id":"OESA-2024-1263","title":"stb security update","description":"Single-file public domain libraries for C/C++.\r\n\r\nSecurity Fix(es):\r\n\r\nstb_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(CVE-2023-45666)\r\n\r\nstb_image is a single file MIT licensed library for processing images.\r\n\r\nIf `stbi__load_gif_main` in `stbi_load_gif_from_memory` fails it returns a null pointer and may keep the `z` variable uninitialized. In case the caller also sets the flip vertically flag, it continues and calls `stbi__vertical_flip_slices` with the null pointer result value and the uninitialized `z` value. This may result in a program crash.(CVE-2023-45667)","status":"published","published":"2024-03-08T11:06:42Z","modified":"2026-08-18T01:18:18.654463466Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"updated_at":"2026-11-02T15:52:40.71472Z"},{"id":"UBUNTU-CVE-2023-45667","description":"stb_image is a single file MIT licensed library for processing images. If `stbi__load_gif_main` in `stbi_load_gif_from_memory` fails it returns a null pointer and may keep the `z` variable uninitialized. In case the caller also sets the flip vertically flag, it continues and calls `stbi__vertical_flip_slices` with the null pointer result value and the uninitialized `z` value. This may result in a program crash.","status":"published","published":"2023-10-21T00:15:00Z","modified":"2026-10-17T12:57:21.395616756Z","cvss":[{"version":"3.1","score":5.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","level":"medium"},{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high"}],"updated_at":"2026-11-02T16:54:22.741943Z"}]}}
