Skip to main content
EPSS 0.6%top 54%

CVE-2026-24001: CWE-400: Uncontrolled Resource Consumption in kpdecker jsdiff

0
Low
VulnerabilityCVE-2026-24001cvecve-2026-24001cwe-400cwe-1333
Published: 01/22/2026 (01/22/2026, 02:23:44 UTC)
Source: CVE Database V5
Vendor/Project: kpdecker
Product: jsdiff

Description

jsdiff is a JavaScript text differencing implementation. Prior to versions 8.0.3, 5.2.2, 4.0.4, and 3.5.1, attempting to parse a patch whose filename headers contain the line break characters `\r`, `\u2028`, or `\u2029` can cause the `parsePatch` method to enter an infinite loop. It then consumes memory without limit until the process crashes due to running out of memory. Applications are therefore likely to be vulnerable to a denial-of-service attack if they call `parsePatch` with a user-provided patch as input. A large payload is not needed to trigger the vulnerability, so size limits on user input do not provide any protection. Furthermore, some applications may be vulnerable even when calling `parsePatch` on a patch generated by the application itself if the user is nonetheless able to control the filename headers (e.g. by directly providing the filenames of the files to be diffed). The `applyPatch` method is similarly affected if (and only if) called with a string representation of a patch as an argument, since under the hood it parses that string using `parsePatch`. Other methods of the library are unaffected. Finally, a second and lesser interdependent bug - a ReDOS - also exhibits when those same line break characters are present in a patch's *patch* header (also known as its "leading garbage"). A maliciously-crafted patch header of length *n* can take `parsePatch` O(*n*³) time to parse. Versions 8.0.3, 5.2.2, 4.0.4, and 3.5.1 contain a fix. As a workaround, do not attempt to parse patches that contain any of these characters: `\r`, `\u2028`, or `\u2029`.

CVSS v4.0

Score 2.7low

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
None
Vuln. Confidentiality
None
Vuln. Integrity
None
Vuln. Availability
Low
Subsq. Confidentiality
None
Subsq. Integrity
None
Subsq. Availability
None
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N/E:U

Affected software

kpdecker

jsdiff

Affected versions
>=6.0.0 <8.0.3>=5.0.0 <5.2.2>=4.0.0 <4.0.4<3.5.1
jsdiff
pkg:npm/jsdiff
Affected versions
<3.5.1

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 07/15/2026, 08:37:03 UTC

Technical Analysis

The jsdiff JavaScript library (versions before 3.5.1) has an uncontrolled resource consumption vulnerability (CWE-400) in its parsePatch method. When parsing patches whose filename headers contain the characters \r, \u2028, or \u2029, parsePatch can enter an infinite loop, consuming memory until the process crashes. This can lead to denial-of-service if user input is parsed without validation. The applyPatch method is also affected when called with a string patch argument, as it internally calls parsePatch. Additionally, a related Regular Expression Denial of Service (ReDOS) vulnerability (CWE-1333) causes parsePatch to take O(n³) time when malicious patch headers contain these characters. Fixed in versions 3.5.1, 4.0.4, 5.2.2, and 8.0.3. The Red Hat advisory confirms these details but does not provide additional remediation beyond the fixed versions.

Potential Impact

Exploitation of this vulnerability can cause applications using vulnerable jsdiff versions to consume excessive memory or CPU resources, leading to denial-of-service conditions. This can occur even with small inputs containing specific line break characters in patch filename headers. The vulnerability affects any application calling parsePatch or applyPatch with user-controlled patch strings containing these characters.

Mitigation Recommendations

Fixed versions 3.5.1, 4.0.4, 5.2.2, and 8.0.3 of jsdiff are available and should be applied to remediate this vulnerability. As a workaround, avoid parsing patches containing the characters \r, \u2028, or \u2029 in filename headers. No other methods in the library are affected. Review application logic to ensure user input is validated before calling parsePatch or applyPatch.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Data Version
5.2
Assigner Short Name
GitHub_M
Date Reserved
2026-01-19T18:49:20.658Z
Cvss Version
4.0
State
PUBLISHED
Vendor Advisory Urls
[{"url":"https://access.redhat.com/security/cve/CVE-2026-24001","vendor":"Red Hat"}]

Threat ID: 697190914623b1157c0cb7f8

Added to database: 01/22/2026, 02:50:57 UTC

Last enriched: 07/15/2026, 08:37:03 UTC

Last updated: 09/10/2026, 22:21:57 UTC

Views: 347

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses