jsdiff has a Denial of Service vulnerability in parsePatch and applyPatch
Overview
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
- 1/22/2026
- Last modified
- 7/15/2026
- CVE assigner
- Not available
- NVD analysis
- Not available
Exploitation
No CISA KEV flag in the saved record
An absent KEV flag does not establish that exploitation has never occurred. Verify current intelligence before prioritizing work.
EPSS predictions and CISA SSVC assessments are not imported here. Review additional intelligence on Cloudflare
Affected products
Affected-version rules published in the advisory. Conditions and uncertain comparisons require verification.
| Vendor / product | Affected versions | Platform / conditions | Evidence |
|---|---|---|---|
jsdiff kpdecker | < 3.5.1 | Verify advisory The advisory has platform, edition, hardware, or configuration conditions not verified by software inventory. | Source |
jsdiff kpdecker | ≥ 4.0.0, < 4.0.4 | Verify advisory The advisory has platform, edition, hardware, or configuration conditions not verified by software inventory. | Source |
jsdiff kpdecker | ≥ 5.0.0, < 5.2.2 | Verify advisory The advisory has platform, edition, hardware, or configuration conditions not verified by software inventory. | Source |
jsdiff kpdecker | ≥ 6.0.0, < 8.0.3 | Verify advisory The advisory has platform, edition, hardware, or configuration conditions not verified by software inventory. | Source |
jsdiff kpdecker | >= 6.0.0, < 8.0.3 | Verify advisory Verify the advisory platform, edition, update channel, and any version exceptions. | Source |
jsdiff kpdecker | >= 5.0.0, < 5.2.2 | Verify advisory Verify the advisory platform, edition, update channel, and any version exceptions. | Source |
jsdiff kpdecker | >= 4.0.0, < 4.0.4 | Verify advisory Verify the advisory platform, edition, update channel, and any version exceptions. | Source |
jsdiff kpdecker | < 3.5.1 | Verify advisory Verify the advisory platform, edition, update channel, and any version exceptions. | Source |
Recommended actions
Verify the product, installed version, platform, and advisory prerequisites on each system. Apply the vendor's applicable fixed release or mitigation. An affected-range boundary alone is not a universal update recommendation.
Vendor advisory links
Derived from non-aggregator references because the source record has no vendor tags. Verify the advisory before acting on it.
Severity
CVSS describes technical impact. It is separate from exploitation evidence.
Published headline score: 2.7. Score version, vector, and attribution are not available in this record. Additional score details appear when the source record is next refreshed.
Sources & references
Sources: Official CVE List, NVD and cve.now (summaries CC BY 4.0). Uses NVD data; not endorsed by NVD.