Every CVE Search/ Get API key

CVE-2023-45662

Multi-byte read heap buffer overflow in stbi__vertical_flip in stb_image

6.5 MediumFix available

CVE-2023-45662 is a medium vulnerability (CVSS 6.5) in Nothings Stb, published October 20, 2023. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.81%, the 56th percentile. Fixed in stb 0_git20231012-r0.

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.

Attack profile

How easy it is to exploit

Attack vector
Network
Complexity
Low
Privileges needed
None
User interaction
None

What an attacker can affect

Confidentiality
Low
Integrity
None
Availability
Low

Exploit likelihood

0.81%Up 0.8 points since Oct 21, 2023
90%50%10%1%

What each source reports

CVE List Score used 6.5

Multi-byte read heap buffer overflow in stbi__vertical_flip in stb_image

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.

Record
CVE-2023-45662
CVSS 3.1
6.5 MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:L
Weakness
CWE-125
Updated
2026-11-02
EUVDEUVD-2023-49953 6.5

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.

Record
EUVD-2023-49953
CVSS 3.1
6.5 MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:L
Updated
2026-11-03
NVD 6.5

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.

Record
CVE-2023-45662
CVSS 3.1
6.5 MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:L
CVSS 3.1
8.1 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:H
Weakness
CWE-125
Updated
2026-11-02
OSVALPINE-CVE-2023-45662 8.1

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.

Record
ALPINE-CVE-2023-45662
CVSS 3.1
8.1 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:H
Updated
2026-11-03
OSV 6.5

Multi-byte read heap buffer overflow in stbi__vertical_flip in stb_image

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.

Record
CVE-2023-45662
CVSS 3.1
6.5 MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:L
Weakness
CWE-125
Updated
2026-11-02
OSVDEBIAN-CVE-2023-45662 8.1

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.

Record
DEBIAN-CVE-2023-45662
CVSS 3.1
8.1 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:H
Updated
2026-11-02
OSVOESA-2024-1230 8.1

stb security update

Single-file public domain libraries for C/C++.

Security Fix(es):

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.(CVE-2023-45662)

stb_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)

Record
OESA-2024-1230
CVSS 3.1
8.1 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:H
Updated
2026-11-02
OSVOESA-2024-1231 8.1

stb security update

Single-file public domain libraries for C/C++.

Security Fix(es):

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.(CVE-2023-45662)

stb_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)

Record
OESA-2024-1231
CVSS 3.1
8.1 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:H
Updated
2026-11-02
OSVUBUNTU-CVE-2023-45662 6.5

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.

Record
UBUNTU-CVE-2023-45662
CVSS 3.1
6.5 MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:L
CVSS 3.1
8.1 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:H
Updated
2026-11-02

Affected products

Affected packages

Affected packages
PackageAffectedFixed
stb
Alpine:v3.19
before 0_git20231012-r0
0_git20231012-r0
stb
Alpine:v3.20
before 0_git20231012-r0
0_git20231012-r0
stb
Alpine:v3.21
before 0_git20231012-r0
0_git20231012-r0
stb
Alpine:v3.22
before 0_git20231012-r0
0_git20231012-r0
stb
Alpine:v3.23
before 0_git20231012-r0
0_git20231012-r0
stb
Alpine:v3.24
before 0_git20231012-r0
0_git20231012-r0
libstb
Debian:12
All versions, plus listed versions
0.0~git20220908.8b5f1f3+ds-10.0~git20230129.5736b15+ds-10.0~git20230129.5736b15+ds-1.10.0~git20230129.5736b15+ds-1.1~exp10.0~git20230129.5736b15+ds-1.20.0~git20240715.f7f20f39fe4f+ds-10.0~git20241109.5c20573+ds-10.0~git20250907.fede005+ds-1
None known
libstb
Debian:13
All versions, plus listed versions
0.0~git20241109.5c20573+ds-10.0~git20250907.fede005+ds-1
None known
libstb
Debian:14
All versions, plus listed versions
0.0~git20241109.5c20573+ds-10.0~git20250907.fede005+ds-1
None known
stb
openEuler:22.03-LTS-SP2
before 0.20220908git8b5f1f3-0.10.oe2203sp2
0.20220908git8b5f1f3-0.10.oe2203sp2
Show 7 moreShow less
Affected packages
PackageAffectedFixed
stb
openEuler:22.03-LTS-SP3
before 0.20220908git8b5f1f3-0.10.oe2203sp3
0.20220908git8b5f1f3-0.10.oe2203sp3
libstb
Ubuntu:20.04:LTS
All versions, plus listed versions
0.0~git20190817.1.052dce1-1
None known
libstb
Ubuntu:22.04:LTS
All versions, plus listed versions
0.0~git20200713.b42009b+ds-10.0~git20210910.af1a5bc+ds-1
None known
libstb
Ubuntu:24.04:LTS
All versions, plus listed versions
0.0~git20230129.5736b15+ds-10.0~git20230129.5736b15+ds-1.10.0~git20230129.5736b15+ds-1.2
None known
libstb
Ubuntu:25.10
All versions, plus listed versions
0.0~git20240715.f7f20f39fe4f+ds-10.0~git20241109.5c20573+ds-1
None known
libstb
Ubuntu:26.10
All versions, plus listed versions
0.0~git20250907.fede005+ds-1
None known
libstb
Ubuntu:26.04:LTS
All versions, plus listed versions
0.0~git20241109.5c20573+ds-10.0~git20250907.fede005+ds-1
None known

History

History
WhenChangedSources
2026-11-03affected, aliases, referencesOSV
2026-11-03aliases, publishedEUVD
2026-11-02createdCVE List, NVD, OSV

References

Show 8 moreShow less
MoveEnter Open