GHSA-73RR-HH4G-FPGX

Diffing Dangerously: Infinite Loops and ReDoS in jsdiff

Alon Barad
Alon Barad
Software Engineer

Jan 14, 2026·6 min read·9 visits

Executive Summary (TL;DR)

The `jsdiff` library (< 8.1.0) fails to handle Unicode line separators correctly in its patch parser. A crafted patch file containing characters like `\u2028` in a filename can trap the parser in an infinite loop, causing memory exhaustion. Additionally, a ReDoS flaw exists in how patch headers are processed. Upgrading to 8.1.0 fixes this by replacing complex regexes with string manipulation.

A critical Denial of Service vulnerability in the popular `jsdiff` library. By exploiting JavaScript's quirk regarding regex dot-matching and line separators, attackers can trigger an infinite loop or catastrophic backtracking (ReDoS), effectively freezing Node.js applications that parse patches.

Fix Analysis (1)

Technical Appendix

CVSS Score
7.5/ 10
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
EPSS Probability
0.04%
Top 100% most exploited

Affected Systems

jsdiff < 8.1.0Node.js applications processing user-submitted patchesGit integration tools built on JavaScriptTest frameworks using jsdiff for assertions

Affected Versions Detail

Product
Affected Versions
Fixed Version
jsdiff
kpdecker
< 8.1.08.1.0
AttributeDetail
Vulnerability TypeDenial of Service (DoS)
WeaknessesCWE-1333 (ReDoS), CWE-835 (Infinite Loop)
CVSS Estimate7.5 (High)
Attack VectorNetwork (Input-based)
Affected Componentsrc/patch/parse.ts (parsePatch)
Patch Commit15a1585230748c8ae6f8274c202e0c87309142f5
CWE-1333
Inefficient Regular Expression Complexity

Inefficient Regular Expression Complexity and Loop with Unreachable Exit Condition

Vulnerability Timeline

Vulnerability Published
2026-01-14
Fix Merged (v8.1.0)
2026-01-14