{"id":"CVE-2023-45661","aliases":["ALPINE-CVE-2023-45661","DEBIAN-CVE-2023-45661","EUVD-2023-49952","OESA-2023-1866","UBUNTU-CVE-2023-45661"],"status":"published","title":"Wild address read in stbi__gif_load_next in stb_image","description":"stb_image is a single file MIT licensed library for processing images. A crafted image file may trigger out of bounds memcpy read in `stbi__gif_load_next`. This happens because two_back points to a memory address lower than the start of the buffer out. This issue may be used to leak internal memory allocation information.","severity":{"version":"3.1","score":6.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:L","level":"medium","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-12","score":0.00572,"percentile":0.47788,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-125"],"published":"2023-10-20T23:26:08Z","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-SP2","package":"stb","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.20220908git8b5f1f3-0.8.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#L6817","tags":["x_refsource_MISC","x_transferred","Patch","Third Party Advisory","web","report"]},{"url":"https://github.com/nothings/stb/blob/5736b15f7ea0ffb08dd38af21067c314d6a3aae9/stb_image.h#L7021-L7022","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-45661","tags":["advisory"]},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/45xxx/CVE-2023-45661.json","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2023-45661","tags":["advisory"]},{"url":"https://security-tracker.debian.org/tracker/CVE-2023-45661","tags":["advisory"]},{"url":"https://www.openeuler.org/en/security/safety-bulletin/detail.html?id=openEuler-SA-2023-1866","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2023-45664","tags":["advisory"]},{"url":"https://ubuntu.com/security/CVE-2023-45661","tags":["report"]},{"url":"https://www.cve.org/CVERecord?id=CVE-2023-45661","tags":["report"]}],"sources":{"cve":[{"id":"CVE-2023-45661","title":"Wild address read in stbi__gif_load_next in stb_image","description":"stb_image is a single file MIT licensed library for processing images. A crafted image file may trigger out of bounds memcpy read in `stbi__gif_load_next`. This happens because two_back points to a memory address lower than the start of the buffer out. This issue may be used to leak internal memory allocation information.","status":"published","published":"2023-10-20T23:26:08.605Z","modified":"2025-02-13T17:14:04.182Z","cvss":[{"version":"3.1","score":6.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:L","level":"medium","assessor":"cna"}],"cwes":["CWE-125"],"updated_at":"2026-11-02T14:35:22.640346Z"}],"euvd":[{"id":"EUVD-2023-49952","description":"stb_image is a single file MIT licensed library for processing images. A crafted image file may trigger out of bounds memcpy read in `stbi__gif_load_next`. This happens because two_back points to a memory address lower than the start of the buffer out. This issue may be used to leak internal memory allocation information.","status":"published","published":"2023-10-20T23:26:08Z","modified":"2025-02-13T17:14:04Z","cvss":[{"version":"3.1","score":6.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:L","level":"medium"}],"updated_at":"2026-11-03T00:03:48.562419Z"}],"nvd":[{"id":"CVE-2023-45661","description":"stb_image is a single file MIT licensed library for processing images. A crafted image file may trigger out of bounds memcpy read in `stbi__gif_load_next`. This happens because two_back points to a memory address lower than the start of the buffer out. This issue may be used to leak internal memory allocation information.","status":"published","published":"2023-10-21T00:15:08.783Z","modified":"2026-06-17T06:29:03.107Z","cvss":[{"version":"3.1","score":6.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:L","level":"medium","assessor":"secondary"},{"version":"3.1","score":7.1,"vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:H","level":"high","assessor":"primary"}],"cwes":["CWE-125"],"updated_at":"2026-11-02T14:08:39.058878Z"}],"osv":[{"id":"ALPINE-CVE-2023-45661","description":"stb_image is a single file MIT licensed library for processing images. A crafted image file may trigger out of bounds memcpy read in `stbi__gif_load_next`. This happens because two_back points to a memory address lower than the start of the buffer out. This issue may be used to leak internal memory allocation information.","status":"published","published":"2023-10-21T00:15:08.783Z","modified":"2026-11-03T06:32:43.517911719Z","cvss":[{"version":"3.1","score":7.1,"vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:H","level":"high"}],"updated_at":"2026-11-03T07:17:02.90744Z"},{"id":"CVE-2023-45661","title":"Wild address read in stbi__gif_load_next in stb_image","description":"stb_image is a single file MIT licensed library for processing images. A crafted image file may trigger out of bounds memcpy read in `stbi__gif_load_next`. This happens because two_back points to a memory address lower than the start of the buffer out. This issue may be used to leak internal memory allocation information.","status":"published","published":"2023-10-20T23:26:08.605Z","modified":"2026-03-14T12:20:50.084402Z","cvss":[{"version":"3.1","score":6.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:L","level":"medium"}],"cwes":["CWE-125"],"updated_at":"2026-11-02T15:44:34.287121Z"},{"id":"DEBIAN-CVE-2023-45661","description":"stb_image is a single file MIT licensed library for processing images. A crafted image file may trigger out of bounds memcpy read in `stbi__gif_load_next`. This happens because two_back points to a memory address lower than the start of the buffer out. This issue may be used to leak internal memory allocation information.","status":"published","published":"2023-10-21T00:15:08.783Z","modified":"2026-10-26T18:02:33.613021225Z","cvss":[{"version":"3.1","score":7.1,"vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:H","level":"high"}],"updated_at":"2026-11-02T15:45:40.275853Z"},{"id":"OESA-2023-1866","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. A crafted image file may trigger out of bounds memcpy read in `stbi__gif_load_next`. This happens because two_back points to a memory address lower than the start of the buffer out. This issue may be used to leak internal memory allocation information.(CVE-2023-45661)\r\n\r\nstb_image is a single file MIT licensed library for processing images. A crafted image file can trigger `stbi__load_gif_main_outofmem` attempt to double-free the out variable. This happens in `stbi__load_gif_main` because when the `layers * stride` value is zero the behavior is implementation defined, but common that realloc frees the old memory and returns null pointer. Since it attempts to double-free the memory a few lines below the first “free”, the issue can be potentially exploited only in a multi-threaded environment. In the worst case this may lead to code execution.(CVE-2023-45664)","status":"published","published":"2023-12-01T11:06:18Z","modified":"2026-08-18T01:18:04.795114014Z","cvss":[{"version":"3.1","score":7.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L","level":"high"}],"updated_at":"2026-11-02T15:52:40.71472Z"},{"id":"UBUNTU-CVE-2023-45661","description":"stb_image is a single file MIT licensed library for processing images. A crafted image file may trigger out of bounds memcpy read in `stbi__gif_load_next`. This happens because two_back points to a memory address lower than the start of the buffer out. This issue may be used to leak internal memory allocation information.","status":"published","published":"2023-10-21T00:15:00Z","modified":"2026-10-17T12:57:21.196088013Z","cvss":[{"version":"3.1","score":6.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:L","level":"medium"},{"version":"3.1","score":7.1,"vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:H","level":"high"}],"updated_at":"2026-11-02T16:54:22.741943Z"}]}}
