CVE-2020-28248: Integer Overflow in png-img

png-img Updated 02 Oct 2025

Summary

10/12/2021
Yes i
High
8.8

CVE-2020-28248: Integer Overflow in png-img. Affects png-img versions < 3.1.0. Fixed in 3.1.0. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

The png-img package is an npm package used for working with PNG images. It provides functionality for loading and manipulating PNG files. The package is vulnerable to an integer overflow in the PngImg::InitStorage_() function. This vulnerability occurs when the function fails to allocate enough heap memory, leading to a heap-based buffer overflow. This vulnerability can be exploited by loading a specially crafted PNG file.

Vulnerability Detail

The integer overflow vulnerability in png-img can result in an under-allocation of heap memory, which can then be exploited to trigger a heap-based buffer overflow. An attacker can create a malicious PNG file that, when loaded by an application using the png-img package, can cause the application to overwrite adjacent memory, potentially leading to arbitrary code execution or a denial of service. The vulnerability has a CVSS score of 8.8, indicating a high severity.

How To Fix

Minimum fixed version

3.1.0

This is the first release that contains the fix.

npm install png-img@3.1.0

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

There is no known workaround for this vulnerability. It is recommended to update the package to the latest version as soon as possible.

Conclusion

The png-img package is vulnerable to an integer overflow issue that can lead to a heap-based buffer overflow. This vulnerability can be exploited by loading a specially crafted PNG file. To mitigate the risk, it is recommended to update the package to version 3.1.0 or later. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for png-img →

Share this vulnerability

FAQ

This vulnerability can allow an attacker to execute arbitrary code or cause a denial of service by exploiting the heap-based buffer overflow.

You can use the Vulert Playground (https://vulert.com/scanner) to check if your application is affected by this vulnerability. Simply upload your package-lock.json file and the tool will analyze it for vulnerabilities.

There are no known instances of this vulnerability being exploited in the wild at the time of this report.

Yes, the png-img package has released a fix for this vulnerability in version 3.1.0. It is recommended to update to this version or later.

There is no known workaround for this vulnerability. It is highly recommended to update the package to the latest version to mitigate the risk.

How To Fix

Minimum fixed version

3.1.0

This is the first release that contains the fix.

npm install png-img@3.1.0

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback