# CVE-2026-24001: jsdiff has a Denial of Service vulnerability in parsePatch and applyPatch

> Attackers can cause a denial of service in applications using jsdiff by providing patches with specific line break characters, leading to infinite loops or excessive CPU usage.

- **Severity:** 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`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 22 Jan 2026
- **Updated:** 15 Jul 2026
- **Also known as:** CLEANSTART-2026-JK65997, CLEANSTART-2026-KX54360, CLSA-2026-1773188145, CLSA-2026-1774225207, CLSA-2026-1780361390, CLSA-2026-1780361406, CLSA-2026-1780447848, DEBIAN-CVE-2026-24001, ECHO-c647-d5fa-c4ed, GHSA-73rr-hh4g-fpgx, MINI-2hxw-9x98-mrf5, MINI-3224-jjwg-cm8v, MINI-35jw-mgqx-9wrm, MINI-4p83-vxvw-pcfh, MINI-6fx7-4cpq-7hxg, MINI-75c8-3m5j-gqr7, MINI-8v5q-79r6-j2pf, MINI-c98g-c7jv-x8j9, MINI-f7q3-545q-ccx3, MINI-fcfp-f47m-6hff, MINI-jj4c-r8cq-2cfw, MINI-p7gm-rqq5-3ph6, MINI-pw98-q6c2-w97p, MINI-qgf9-84qp-4fp2, MINI-xpcr-3wjr-628g, ROOT-APP-NPM-CVE-2026-24001, UBUNTU-CVE-2026-24001

## What is CVE-2026-24001?

CVE-2026-24001 is a low-severity denial of service vulnerability in kpdecker jsdiff, published on 22 Jan 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official 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`.

Weakness: CWE-400 (Uncontrolled Resource Consumption), CWE-1333 (Inefficient Regular Expression Complexity)

## Which versions are affected by CVE-2026-24001?

8 open source packages ship an affected version, including diff. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `diff` | npm | All versions | 3.5.1 |
| `diff` | npm | All versions | 3.5.1 |
| `diff` | npm | From 4.0.0 | 4.0.4 |
| `diff` | npm | From 4.0.0 | 4.0.4 |
| `diff` | npm | From 5.0.0 | 5.2.2 |
| `diff` | npm | From 5.0.0 | 5.2.2 |
| `diff` | npm | From 6.0.0 | 8.0.3 |
| `diff` | npm | From 6.0.0 | 8.0.3 |

Products: Kpdecker Jsdiff.

## How do I fix CVE-2026-24001?

Upgrade diff to a fixed version for your release line: 3.5.1, 4.0.4, 5.2.2 or 8.0.3.

## Is CVE-2026-24001 being exploited?

There is no known exploitation of CVE-2026-24001 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-24001 and fix it if it is affected.

What it is: CVE-2026-24001 is a low-severity denial of service vulnerability in kpdecker jsdiff, published on 22 Jan 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2026-24001 in the wild and no public exploit code.

Affected packages and fixed versions:
- diff (npm): affected all versions; fixed in 3.5.1
- diff (npm): affected all versions; fixed in 3.5.1
- diff (npm): affected from 4.0.0; fixed in 4.0.4
- diff (npm): affected from 4.0.0; fixed in 4.0.4
- diff (npm): affected from 5.0.0; fixed in 5.2.2
- diff (npm): affected from 5.0.0; fixed in 5.2.2
- diff (npm): affected from 6.0.0; fixed in 8.0.3
- diff (npm): affected from 6.0.0; fixed in 8.0.3

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-24001/ (Markdown: https://insights.sbomify.com/CVE-2026-24001/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-24001
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-24001
- OSV: https://osv.dev/vulnerability/CVE-2026-24001

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-24001/
Summaries are generated and may contain mistakes; the official description above is the record.
