CVE-2026-24001: CWE-400: Uncontrolled Resource Consumption in kpdecker jsdiff
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`.
AI Analysis
Technical Summary
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.
CVE-2026-24001: CWE-400: Uncontrolled Resource Consumption in kpdecker 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
Affected software
kpdecker
jsdiff
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
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.
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 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
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
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.