Vulnerabilities in pkg:npm/png-img
PACKAGECVE-2020-28248 is a HIGH (CVSS 8.8) integer overflow vulnerability (CWE-190: Integer Overflow or Wraparound) affecting Png img libraries in the npm ecosystem. The issue involves integer overflow in png-img. Remediation is available by upgrading affected packages to version 3.1.0.
pkg:npm/png-img
Vulnerability advisories affecting package pkg:npm/png-img. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-q5wr-fvpq-p67g | CVE-2020-28248 | HIGH | Integer Overflow in png-img |
CVE-2020-28248 at a Glance
Security Impact
CVSS: 8.8
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H).
How to Fix CVE-2020-28248
To remediate this vulnerability, upgrade all affected Png img dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install png-img@3.1.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls png-img
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2020-28248, inspect your project dependencies using npm:
npm ls png-img
Analyze the terminal output to locate any version of Png img in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.1.0), your application is affected.
Note: The npm ls png-img command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-190: Integer Overflow or Wraparound, where the product performs a calculation that can produce an integer overflow or wraparound when the logic assumes that the resulting value will always be larger than the original value. this occurs when an integer value is incremented to a value that is too large to store in the associated representation. when this occurs, the value may become a very small or negative number. In Png img, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2020-28248 Affected Png img Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
png-img
|
npm |
< 3.1.0
|
3.1.0
|
References
Frequently Asked Questions
What is CVE-2020-28248?
Which Png img versions are affected?
What version fixes CVE-2020-28248?
Is png-img affected?
What is the CVSS score of CVE-2020-28248?
What CWE is associated with CVE-2020-28248?
How can I check npm dependencies for CVE-2020-28248?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-q5wr-fvpq-p67g",
"modified" : "2021-07-26T18:09:11Z",
"published" : "2021-12-10T17:23:30Z",
"aliases" : [ "CVE-2020-28248" ],
"summary" : "Integer Overflow in png-img",
"details" : "An integer overflow in the PngImg::InitStorage_() function of png-img before 3.1.0 leads to an under-allocation of heap memory and subsequently an exploitable heap-based buffer overflow when loading a crafted PNG file.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "png-img"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "3.1.0"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-28248"
}, {
"type" : "WEB",
"url" : "https://github.com/gemini-testing/png-img/commit/14ac462a32ca4b3b78f56502ac976d5b0222ce3d"
}, {
"type" : "WEB",
"url" : "https://github.com/gemini-testing/png-img"
}, {
"type" : "WEB",
"url" : "https://github.com/gemini-testing/png-img/compare/v3.0.0...v3.1.0"
}, {
"type" : "ADVISORY",
"url" : "https://securitylab.github.com/advisories/GHSL-2020-142-gemini-png-img"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-190", "CWE-787" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2021-07-26T18:09:11Z",
"nvd_published_at" : "2021-02-20T00:15:00Z"
}
}