{"id":"CVE-2023-45662","aliases":["ALPINE-CVE-2023-45662","DEBIAN-CVE-2023-45662","EUVD-2023-49953","OESA-2024-1230","OESA-2024-1231","UBUNTU-CVE-2023-45662"],"status":"published","title":"Multi-byte read heap buffer overflow in stbi__vertical_flip in stb_image","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.","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.00807,"percentile":0.57301,"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:11Z","modified":"2026-11-03T06:32:02Z","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.10.oe2203sp2"}]}],"bundled":2},{"source":"osv","ecosystem":"openEuler:22.03-LTS-SP3","package":"stb","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.20220908git8b5f1f3-0.10.oe2203sp3"}]}],"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#L1235","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-45662","tags":["advisory"]},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/45xxx/CVE-2023-45662.json","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2023-45662","tags":["advisory"]},{"url":"https://security-tracker.debian.org/tracker/CVE-2023-45662","tags":["advisory"]},{"url":"https://www.openeuler.org/en/security/safety-bulletin/detail.html?id=openEuler-SA-2024-1230","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2023-45663","tags":["advisory"]},{"url":"https://www.openeuler.org/en/security/safety-bulletin/detail.html?id=openEuler-SA-2024-1231","tags":["advisory"]},{"url":"https://ubuntu.com/security/CVE-2023-45662","tags":["report"]},{"url":"https://www.cve.org/CVERecord?id=CVE-2023-45662","tags":["report"]}],"sources":{"cve":[{"id":"CVE-2023-45662","title":"Multi-byte read heap buffer overflow in stbi__vertical_flip in stb_image","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.","status":"published","published":"2023-10-20T23:26:11.578Z","modified":"2025-02-13T17:14:04.772Z","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.984825Z"}],"euvd":[{"id":"EUVD-2023-49953","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.","status":"published","published":"2023-10-20T23:26:11Z","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-45662","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.","status":"published","published":"2023-10-21T00:15:08.867Z","modified":"2026-06-17T06:29:03.593Z","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":8.1,"vector":"CVSS:3.1/AV:N/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-45662","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.","status":"published","published":"2023-10-21T00:15:08.867Z","modified":"2026-11-03T06:32:02.944656399Z","cvss":[{"version":"3.1","score":8.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:H","level":"high"}],"updated_at":"2026-11-03T07:18:15.355745Z"},{"id":"CVE-2023-45662","title":"Multi-byte read heap buffer overflow in stbi__vertical_flip in stb_image","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.","status":"published","published":"2023-10-20T23:26:11.578Z","modified":"2026-03-14T12:20:49.617007Z","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-45662","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.","status":"published","published":"2023-10-21T00:15:08.867Z","modified":"2026-10-26T18:03:06.759916429Z","cvss":[{"version":"3.1","score":8.1,"vector":"CVSS:3.1/AV:N/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-2024-1230","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. 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.(CVE-2023-45662)\r\n\r\nstb_image is a single file MIT licensed library for processing images. The stbi__getn function reads a specified number of bytes from context (typically a file) into the specified buffer. In case the file stream points to the end, it returns zero. There are two places where its return value is not checked: In the `stbi__hdr_load` function and in the `stbi__tga_load` function. The latter of the two is likely more exploitable as an attacker may also control the size of an uninitialized buffer.(CVE-2023-45663)","status":"published","published":"2024-03-01T11:06:40Z","modified":"2026-08-18T01:18:17.556847442Z","cvss":[{"version":"3.1","score":8.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:H","level":"high"}],"updated_at":"2026-11-02T15:52:40.71472Z"},{"id":"OESA-2024-1231","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. 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.(CVE-2023-45662)\r\n\r\nstb_image is a single file MIT licensed library for processing images. The stbi__getn function reads a specified number of bytes from context (typically a file) into the specified buffer. In case the file stream points to the end, it returns zero. There are two places where its return value is not checked: In the `stbi__hdr_load` function and in the `stbi__tga_load` function. The latter of the two is likely more exploitable as an attacker may also control the size of an uninitialized buffer.(CVE-2023-45663)","status":"published","published":"2024-03-01T11:06:40Z","modified":"2026-08-18T01:18:17.660000413Z","cvss":[{"version":"3.1","score":8.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:H","level":"high"}],"updated_at":"2026-11-02T15:52:40.71472Z"},{"id":"UBUNTU-CVE-2023-45662","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.","status":"published","published":"2023-10-21T00:15:00Z","modified":"2026-10-17T12:57:21.08067808Z","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":8.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:H","level":"high"}],"updated_at":"2026-11-02T16:54:22.741943Z"}]}}
