CVE-2022-25851: Jpeg js Infinite Loop Vulnerability
HIGHCVE-2022-25851 is a HIGH (CVSS 7.5) infinite loop vulnerability (CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop')) affecting Jpeg js libraries in the npm ecosystem. The issue involves infinite loop in jpeg-js. Remediation is available by upgrading affected packages to version 0.4.4.
CVE-2022-25851 at a Glance
Security Impact
CVSS: 7.5
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:N/S:U/C:N/I:N/A:H).
How to Fix CVE-2022-25851
To remediate this vulnerability, upgrade all affected Jpeg js 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 jpeg-js@0.4.4
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls jpeg-js
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2022-25851, inspect your project dependencies using npm:
npm ls jpeg-js
Analyze the terminal output to locate any version of Jpeg js in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.4.4), your application is affected.
Note: The npm ls jpeg-js 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-835: Loop with Unreachable Exit Condition ('Infinite Loop'), where the product contains an iteration or loop with an exit condition that cannot be reached, i.e., an infinite loop. In Jpeg js, 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-2022-25851 Affected Jpeg js Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
jpeg-js
|
npm |
< 0.4.4
|
0.4.4
|
References
Frequently Asked Questions
What is CVE-2022-25851?
Which Jpeg js versions are affected?
What version fixes CVE-2022-25851?
Is jpeg-js affected?
What is the CVSS score of CVE-2022-25851?
What CWE is associated with CVE-2022-25851?
How can I check npm dependencies for CVE-2022-25851?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-xvf7-4v9q-58w6",
"modified" : "2022-06-20T21:58:35Z",
"published" : "2022-06-11T00:00:17Z",
"aliases" : [ "CVE-2022-25851" ],
"summary" : "Infinite loop in jpeg-js",
"details" : "The package jpeg-js before 0.4.4 is vulnerable to Denial of Service (DoS) where a particular piece of input will cause the program to enter an infinite loop and never return.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "jpeg-js"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.4.4"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-25851"
}, {
"type" : "WEB",
"url" : "https://github.com/jpeg-js/jpeg-js/issues/105"
}, {
"type" : "WEB",
"url" : "https://github.com/jpeg-js/jpeg-js/pull/106"
}, {
"type" : "WEB",
"url" : "https://github.com/jpeg-js/jpeg-js/commit/9ccd35fb5f55a6c4f1902ac5b0f270f675750c27"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/jpeg-js/jpeg-js"
}, {
"type" : "WEB",
"url" : "https://snyk.io/vuln/SNYK-JAVA-ORGWEBJARSNPM-2860295"
}, {
"type" : "WEB",
"url" : "https://snyk.io/vuln/SNYK-JS-JPEGJS-2859218"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-835" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2022-06-17T01:00:49Z",
"nvd_published_at" : "2022-06-10T20:15:00Z"
}
}