CVE-2021-42716: Buffer Overflow

Published Oct 21, 2021
·
Updated

An issue was discovered in stb stbimage.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 stbimage, or read up to 1024 bytes of non-consecutive heap data without control over the read location.

Affected Software

4 affected components
Nothings Stb Image.h=2.27
fedoraproject fedora=33
fedoraproject fedora=34
fedoraproject fedora=35

Event History

Oct 21, 2021
CVE Published
via MITRE·06:36 PM
Data Sourced
via MITRE·06:36 PM
Description
Data Sourced
via NVD·07:15 PM
DescriptionSeverityWeaknessAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is CVE-2021-42716?

CVE-2021-42716 is a vulnerability in stb_image.h version 2.27 where the PNM loader incorrectly interprets 16-bit PGM files as 8-bit, leading to a buffer overflow.

2

What is the severity of CVE-2021-42716?

The severity of CVE-2021-42716 is high with a CVSS score of 7.1.

3

How does CVE-2021-42716 affect software?

CVE-2021-42716 affects software that uses stb_image.h version 2.27, including Nothings Stb Image.h and Fedora versions 33, 34, and 35.

4

What is the impact of CVE-2021-42716?

The impact of CVE-2021-42716 is that an attacker could crash a service using stb_image or potentially execute arbitrary code.

5

How can I fix CVE-2021-42716?

To fix CVE-2021-42716, it is recommended to update to a fixed version of stb_image.h and follow any provided patches or fixes.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203