{"id":"CVE-2021-42716","aliases":["DEBIAN-CVE-2021-42716","EUVD-2021-29676","GHSA-44mr-92xw-jfrv","MGASA-2021-0549","MGASA-2022-0074","SUSE-SU-2022:0157-1","SUSE-SU-2022:0163-1","UBUNTU-CVE-2021-42716","openSUSE-SU-2022:0018-1","openSUSE-SU-2022:0157-1","openSUSE-SU-2024:11686-1"],"status":"published","title":"An issue was discovered in stb stb_image.h 2.27. The PNM loader incorrectly interpreted 16-bit...","description":"An issue was discovered in stb stb_image.h 2.27. The PNM loader incorrectly interpreted 16-bit PGM files as 8-bit when converting to RGBA, leading to a buffer overflow when later reinterpreting the result as a 16-bit buffer. An attacker could potentially have crashed a service using stb_image, or read up to 1024 bytes of non-consecutive heap data without control over the read location.","severity":{"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","from":"nvd"},"epss":{"day":"2026-11-11","score":0.01456,"percentile":0.73828,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-120"],"published":"2021-10-21T18:36:39Z","modified":"2026-10-23T18:04:38Z","fixes":[{"ecosystem":"Debian:13","package":"libstb","fixed_in":["0.0~git20230129.5736b15+ds-1"],"sources":["osv"]},{"ecosystem":"Debian:14","package":"libstb","fixed_in":["0.0~git20230129.5736b15+ds-1"],"sources":["osv"]},{"ecosystem":"SUSE:Package Hub 15 SP3","package":"stb","fixed_in":["2.32.1549563867.59e9702-bp153.2.3.1"],"sources":["osv"]},{"ecosystem":"openSUSE:Leap 15.3","package":"stb","fixed_in":["2.32.1549563867.59e9702-bp153.2.3.1"],"sources":["osv"]}],"affected":[{"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"},{"fixed":"0.0~git20230129.5736b15+ds-1"}]}]},{"source":"osv","ecosystem":"Debian:14","package":"libstb","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.0~git20230129.5736b15+ds-1"}]}]},{"source":"osv","ecosystem":"Mageia:8","package":"curaengine","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"4.8.0-1.1.mga8"}]}],"bundled":3},{"source":"osv","ecosystem":"Mageia:8","package":"zxing-cpp","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.1.1-2.1.mga8"}]}],"bundled":3},{"source":"osv","ecosystem":"SUSE:Linux Enterprise Module for Package Hub 15 SP3","package":"zxing-cpp","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.2.0-9.7.1"}]}],"bundled":3},{"source":"osv","ecosystem":"SUSE:Linux Enterprise Workstation Extension 15 SP3","package":"zxing-cpp","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.2.0-9.7.1"}]}],"bundled":3},{"source":"osv","ecosystem":"SUSE:Linux Enterprise Software Development Kit 12 SP5","package":"zxing-cpp","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.2.0-8.6.1"}]}],"bundled":3},{"source":"osv","ecosystem":"SUSE:Linux Enterprise Workstation Extension 12 SP5","package":"zxing-cpp","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.2.0-8.6.1"}]}],"bundled":3},{"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"]},{"source":"osv","ecosystem":"SUSE:Package Hub 15 SP3","package":"stb","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.32.1549563867.59e9702-bp153.2.3.1"}]}]},{"source":"osv","ecosystem":"openSUSE:Leap 15.3","package":"stb","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.32.1549563867.59e9702-bp153.2.3.1"}]}]},{"source":"osv","ecosystem":"openSUSE:Leap 15.3","package":"zxing-cpp","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.2.0-9.7.1"}]}],"bundled":3}],"products":[{"vendor":"fedoraproject","product":"fedora"},{"vendor":"nothings","product":"stb_image.h"}],"references":[{"url":"https://github.com/nothings/stb/issues/1166","tags":["x_refsource_MISC","x_transferred","Exploit","Issue Tracking","Third Party Advisory","report"]},{"url":"https://github.com/nothings/stb/pull/1223","tags":["x_refsource_MISC","x_transferred","Third Party Advisory","advisory","report"]},{"url":"https://github.com/nothings/stb/issues/1225","tags":["x_refsource_MISC","x_transferred","Exploit","Issue Tracking","Third Party Advisory","report"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/G2M5CRSGPRF7G3YB5CLU4FXW7ANNHAYT/","tags":["vendor-advisory","x_refsource_FEDORA","x_transferred","web"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/ID6II3RIKAMVGVMC6ZAQIXXYYDMTVC4N/","tags":["vendor-advisory","x_refsource_FEDORA","x_transferred","web"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/BEGXBDEMTFGINETMJENBZ6SCHVEJQJSY/","tags":["vendor-advisory","x_refsource_FEDORA","x_transferred","web"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/CI23LXPEV2GCDQTJSKO6CIILBDTI3R42/","tags":["vendor-advisory","x_refsource_FEDORA","x_transferred","web"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/FTZXHFZD36BGE5P6JF252NZZLKMGCY4T/","tags":["vendor-advisory","x_refsource_FEDORA","x_transferred","web"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/VP2YEXEAJWI76FPM7D7VXHWD3WESQEYC/","tags":["vendor-advisory","x_refsource_FEDORA","x_transferred","web"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/3TDGZFLBOP27LZKLH45WQLSNPSPP7S7Z/","tags":["vendor-advisory","x_refsource_FEDORA","x_transferred","web"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/AF2CNP4FVC6LDKNOO4WDCGNDYIP3MPK6/","tags":["vendor-advisory","x_refsource_FEDORA","x_transferred","web"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/TXX76TJMZBPN3NU542MGN6B7C7QHRFGB/","tags":["vendor-advisory","x_refsource_FEDORA","x_transferred","web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-42716"},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/3TDGZFLBOP27LZKLH45WQLSNPSPP7S7Z/"},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/AF2CNP4FVC6LDKNOO4WDCGNDYIP3MPK6/"},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/BEGXBDEMTFGINETMJENBZ6SCHVEJQJSY/"},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/CI23LXPEV2GCDQTJSKO6CIILBDTI3R42/"},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/FTZXHFZD36BGE5P6JF252NZZLKMGCY4T/"},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/G2M5CRSGPRF7G3YB5CLU4FXW7ANNHAYT/"},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/ID6II3RIKAMVGVMC6ZAQIXXYYDMTVC4N/"},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/TXX76TJMZBPN3NU542MGN6B7C7QHRFGB/"},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/VP2YEXEAJWI76FPM7D7VXHWD3WESQEYC/"},{"url":"https://github.com/advisories/GHSA-44mr-92xw-jfrv"},{"url":"https://security-tracker.debian.org/tracker/CVE-2021-42716","tags":["advisory"]},{"url":"https://advisories.mageia.org/MGASA-2021-0549.html","tags":["advisory"]},{"url":"https://bugs.mageia.org/show_bug.cgi?id=29622","tags":["report"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/thread/3TDGZFLBOP27LZKLH45WQLSNPSPP7S7Z/","tags":["web"]},{"url":"https://advisories.mageia.org/MGASA-2022-0074.html","tags":["advisory"]},{"url":"https://bugs.mageia.org/show_bug.cgi?id=29937","tags":["report"]},{"url":"https://lists.opensuse.org/archives/list/security-announce@lists.opensuse.org/thread/TPIWID3WJ3SMCA23W52QU3RW6AU7JCA7/","tags":["web","advisory"]},{"url":"https://www.suse.com/support/update/announcement/2022/suse-su-20220157-1/","tags":["advisory"]},{"url":"https://bugzilla.suse.com/1191743","tags":["report"]},{"url":"https://bugzilla.suse.com/1191942","tags":["report"]},{"url":"https://bugzilla.suse.com/1191944","tags":["report"]},{"url":"https://www.suse.com/security/cve/CVE-2021-28021","tags":["web"]},{"url":"https://www.suse.com/security/cve/CVE-2021-42715","tags":["web"]},{"url":"https://www.suse.com/security/cve/CVE-2021-42716","tags":["web"]},{"url":"https://www.suse.com/support/update/announcement/2022/suse-su-20220163-1/","tags":["advisory"]},{"url":"https://ubuntu.com/security/CVE-2021-42716","tags":["report"]},{"url":"https://www.cve.org/CVERecord?id=CVE-2021-42716","tags":["report"]},{"url":"https://lists.opensuse.org/archives/list/security-announce@lists.opensuse.org/thread/G7QRUVRJT5W72APQEDYOZEMCHXZ5CMDO/","tags":["advisory"]},{"url":"","tags":["advisory"]}],"sources":{"cve":[{"id":"CVE-2021-42716","description":"An issue was discovered in stb stb_image.h 2.27. The PNM loader incorrectly interpreted 16-bit PGM files as 8-bit when converting to RGBA, leading to a buffer overflow when later reinterpreting the result as a 16-bit buffer. An attacker could potentially have crashed a service using stb_image, or read up to 1024 bytes of non-consecutive heap data without control over the read location.","status":"published","published":"2021-10-21T18:36:39Z","modified":"2024-08-04T03:38:49.348Z","updated_at":"2026-11-02T14:32:58.739039Z"}],"euvd":[{"id":"EUVD-2021-29676","description":"An issue was discovered in stb stb_image.h 2.27. The PNM loader incorrectly interpreted 16-bit PGM files as 8-bit when converting to RGBA, leading to a buffer overflow when later reinterpreting the result as a 16-bit buffer. An attacker could potentially have crashed a service using stb_image, or read up to 1024 bytes of non-consecutive heap data without control over the read location.","status":"published","published":"2021-10-21T18:36:39Z","modified":"2024-08-04T03:38:49Z","updated_at":"2026-11-03T03:24:15.755984Z"}],"ghsa":[{"id":"GHSA-44mr-92xw-jfrv","title":"An issue was discovered in stb stb_image.h 2.27. The PNM loader incorrectly interpreted 16-bit...","description":"An issue was discovered in stb stb_image.h 2.27. The PNM loader incorrectly interpreted 16-bit PGM files as 8-bit when converting to RGBA, leading to a buffer overflow when later reinterpreting the result as a 16-bit buffer. An attacker could potentially have crashed a service using stb_image, or read up to 1024 bytes of non-consecutive heap data without control over the read location.","status":"published","published":"2022-05-24T19:18:26Z","modified":"2023-01-30T05:03:10Z","cvss":[{"version":"3.1","score":9.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H","level":"critical"}],"cwes":["CWE-120"],"updated_at":"2026-11-02T14:46:46.99354Z"}],"nvd":[{"id":"CVE-2021-42716","description":"An issue was discovered in stb stb_image.h 2.27. The PNM loader incorrectly interpreted 16-bit PGM files as 8-bit when converting to RGBA, leading to a buffer overflow when later reinterpreting the result as a 16-bit buffer. An attacker could potentially have crashed a service using stb_image, or read up to 1024 bytes of non-consecutive heap data without control over the read location.","status":"published","published":"2021-10-21T19:15:08.083Z","modified":"2026-06-17T04:10:00.077Z","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","assessor":"primary"},{"version":"2.0","score":5.8,"vector":"AV:N/AC:M/Au:N/C:P/I:N/A:P","level":"medium","assessor":"primary"}],"cwes":["CWE-120"],"updated_at":"2026-11-02T14:07:00.137719Z"}],"osv":[{"id":"CVE-2021-42716","description":"An issue was discovered in stb stb_image.h 2.27. The PNM loader incorrectly interpreted 16-bit PGM files as 8-bit when converting to RGBA, leading to a buffer overflow when later reinterpreting the result as a 16-bit buffer. An attacker could potentially have crashed a service using stb_image, or read up to 1024 bytes of non-consecutive heap data without control over the read location.","status":"published","published":"2021-10-21T19:15:08.083Z","modified":"2026-04-16T04:37:21.617056104Z","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:44:21.557945Z"},{"id":"DEBIAN-CVE-2021-42716","description":"An issue was discovered in stb stb_image.h 2.27. The PNM loader incorrectly interpreted 16-bit PGM files as 8-bit when converting to RGBA, leading to a buffer overflow when later reinterpreting the result as a 16-bit buffer. An attacker could potentially have crashed a service using stb_image, or read up to 1024 bytes of non-consecutive heap data without control over the read location.","status":"published","published":"2021-10-21T19:15:08.083Z","modified":"2026-10-23T18:04:38.879967017Z","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:35.799676Z"},{"id":"UBUNTU-CVE-2021-42716","description":"An issue was discovered in stb stb_image.h 2.27. The PNM loader incorrectly interpreted 16-bit PGM files as 8-bit when converting to RGBA, leading to a buffer overflow when later reinterpreting the result as a 16-bit buffer. An attacker could potentially have crashed a service using stb_image, or read up to 1024 bytes of non-consecutive heap data without control over the read location.","status":"published","published":"2021-10-21T19:15:00Z","modified":"2026-10-17T12:56:15.603376413Z","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:54:29.220315Z"},{"id":"MGASA-2021-0549","title":"Updated curaengine packages fix security vulnerability","description":"Buffer overflow vulnerability in function stbi__extend_receive in\nstb_image.h in stb 2.26 via a crafted JPEG file. (CVE-2021-28021)\n\nAn issue was discovered in stb stb_image.h 1.33 through 2.27. The HDR\nloader parsed truncated end-of-file RLE scanlines as an infinite sequence\nof zero-length runs. An attacker could potentially have caused denial of\nservice in applications using stb_image by submitting crafted HDR files.\n(CVE-2021-42715)\n\nAn issue was discovered in stb stb_image.h 2.27. The PNM loader\nincorrectly interpreted 16-bit PGM files as 8-bit when converting to RGBA,\nleading to a buffer overflow when later reinterpreting the result as a\n16-bit buffer. An attacker could potentially have crashed a service using\nstb_image, or read up to 1024 bytes of non-consecutive heap data without\ncontrol over the read location. (CVE-2021-42716)\n","status":"published","published":"2021-12-10T22:19:07Z","modified":"2026-04-16T04:43:35.211576016Z","updated_at":"2026-11-02T15:49:41.849028Z"},{"id":"MGASA-2022-0074","title":"Updated zxing-cpp packages fix security vulnerability","description":"Buffer overflow vulnerability in function stbi__extend_receive in stb_image.h\nin stb 2.26 via a crafted JPEG file. (CVE-2021-28021)\n\nAn issue was discovered in stb stb_image.h 1.33 through 2.27. The HDR loader\nparsed truncated end-of-file RLE scanlines as an infinite sequence of\nzero-length runs. An attacker could potentially have caused denial of service\nin applications using stb_image by submitting crafted HDR files.\n(CVE-2021-42715)\n\nAn issue was discovered in stb stb_image.h 2.27. The PNM loader incorrectly\ninterpreted 16-bit PGM files as 8-bit when converting to RGBA, leading to a\nbuffer overflow when later reinterpreting the result as a 16-bit buffer. An\nattacker could potentially have crashed a service using stb_image, or read up\nto 1024 bytes of non-consecutive heap data without control over the read\nlocation. (CVE-2021-42716)\n","status":"published","published":"2022-02-18T00:14:24Z","modified":"2026-04-16T04:43:38.911001955Z","updated_at":"2026-11-02T15:49:41.849028Z"},{"id":"openSUSE-SU-2022:0018-1","title":"Security update for stb","description":"This update for stb fixes the following issues:\n\n- CVE-2021-42716: fixed buffer overflow in stb_image PNM loader (boo#1191743)\n","status":"published","published":"2022-01-21T11:04:52Z","modified":"2026-02-04T02:54:08.669139Z","updated_at":"2026-11-02T16:58:32.653274Z"},{"id":"openSUSE-SU-2022:0157-1","title":"Security update for zxing-cpp","description":"This update for zxing-cpp fixes the following issues:\n\n- CVE-2021-28021: Fixed buffer overflow vulnerability in function stbi__extend_receive in stb_image.h via a crafted JPEG file. (bsc#1191743).\n- CVE-2021-42715: Fixed buffer overflow in stb_image PNM loader (bsc#1191942).\n- CVE-2021-42716: Fixed denial of service in stb_image HDR loader when reading crafted HDR files (bsc#1191944).\n","status":"published","published":"2022-01-24T09:10:46Z","modified":"2025-05-07T18:12:39.751683Z","updated_at":"2026-11-02T16:58:32.653274Z"},{"id":"openSUSE-SU-2024:11686-1","title":"libZXing1-1.2.0-2.1 on GA media","description":"These are all security issues fixed in the libZXing1-1.2.0-2.1 package on the GA media of openSUSE Tumbleweed.","status":"published","published":"2024-06-15T00:00:00Z","modified":"2026-02-04T02:33:09.429457Z","updated_at":"2026-11-02T16:58:35.195147Z"},{"id":"SUSE-SU-2022:0157-1","title":"Security update for zxing-cpp","description":"This update for zxing-cpp fixes the following issues:\n\n- CVE-2021-28021: Fixed buffer overflow vulnerability in function stbi__extend_receive in stb_image.h via a crafted JPEG file. (bsc#1191743).\n- CVE-2021-42715: Fixed buffer overflow in stb_image PNM loader (bsc#1191942).\n- CVE-2021-42716: Fixed denial of service in stb_image HDR loader when reading crafted HDR files (bsc#1191944).\n","status":"published","published":"2022-01-24T09:10:45Z","modified":"2026-02-04T03:30:41.180434Z","updated_at":"2026-11-02T15:53:50.066806Z"},{"id":"SUSE-SU-2022:0163-1","title":"Security update for zxing-cpp","description":"This update for zxing-cpp fixes the following issues:\n\n- CVE-2021-28021: Fixed buffer overflow vulnerability in function stbi__extend_receive in stb_image.h via a crafted JPEG file. (bsc#1191743).\n- CVE-2021-42715: Fixed buffer overflow in stb_image PNM loader (bsc#1191942).\n- CVE-2021-42716: Fixed denial of service in stb_image HDR loader when reading crafted HDR files (bsc#1191944).\n","status":"published","published":"2022-01-24T13:02:51Z","modified":"2026-02-04T03:10:34.500511Z","updated_at":"2026-11-02T15:53:50.066806Z"}]}}
