Security mailing lists by PureSourceCode

CVE-2026-24001

LOW 2.7CVSS 4.0

jsdiff has a Denial of Service vulnerability in parsePatch and applyPatch

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.

Published
22 Jan 2026
Last modified
10 Sep 2026
Assigned by
security-advisories@github.com
NVD status
Modified
Weakness
CWE-1333CWE-400
Also known as
GHSA-73rr-hh4g-fpgx
Sources
NVDJSONOSV GHSA-73rr-hh4g-fpgxJSON

Scores

SourceScored byVersionScoreVector / decision
NVD security-advisories@github.com (Secondary) CVSS 4.0 LOW 2.7 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/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
OSV GitHub CVSS 4.0 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
NVD nvd@nist.gov (Primary) CVSS 3.1 HIGH 7.5 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NVD 0b0ca135-0b70-47e7-9f44-1890c2a1c46c (Secondary) CVSS 3.1 HIGH 7.5 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Affected

SourceVendor / ecosystemProduct / packageAffected versionsFixed in
NVD kpdecker jsdiff
cpe:2.3:a:kpdecker:jsdiff:*:*:*:*:*:node.js:*:*
< 3.5.1 3.5.1
NVD kpdecker jsdiff
cpe:2.3:a:kpdecker:jsdiff:*:*:*:*:*:node.js:*:*
>= 4.0.0, < 4.0.4 4.0.4
NVD kpdecker jsdiff
cpe:2.3:a:kpdecker:jsdiff:*:*:*:*:*:node.js:*:*
>= 5.0.0, < 5.2.2 5.2.2
NVD kpdecker jsdiff
cpe:2.3:a:kpdecker:jsdiff:*:*:*:*:*:node.js:*:*
>= 6.0.0, < 8.0.3 8.0.3
OSV npm diff >= 6.0.0, < 8.0.3 8.0.3
OSV npm diff >= 5.0.0, < 5.2.2 5.2.2
OSV npm diff >= 4.0.0, < 4.0.4 4.0.4
OSV npm diff < 3.5.1 3.5.1

References

History

  • 25 Nov 2026 21:01 UTC · NVD: first stored (published 22 Jan 2026)
  • 25 Nov 2026 20:10 UTC · OSV: first stored (published 14 Jan 2026)
An unhandled error has occurred. Reload ×

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.