Skip to content

Update dependency diff to v5.2.2 [SECURITY] - #15

Open
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/npm-diff-vulnerability
Open

Update dependency diff to v5.2.2 [SECURITY]#15
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/npm-diff-vulnerability

Conversation

@renovate

@renovate renovate Bot commented Jan 15, 2026

Copy link
Copy Markdown

This PR contains the following updates:

Package Change Age Confidence
diff 5.2.05.2.2 age confidence

jsdiff has a Denial of Service vulnerability in parsePatch and applyPatch

CVE-2026-24001 / GHSA-73rr-hh4g-fpgx

More information

Details

Impact

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 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.

Patches

All vulnerabilities described are fixed in v8.0.3.

Workarounds

If using a version of jsdiff earlier than v8.0.3, do not attempt to parse patches that contain any of these characters: \r, \u2028, or \u2029.

References

PR that fixed the bug: https://github.com/kpdecker/jsdiff/pull/649

CVE Notes

Note that although the advisory describes two bugs, they each enable exactly the same attack vector (that an attacker who controls input to parsePatch can cause a DOS). Fixing one bug without fixing the other therefore does not fix the vulnerability and does not provide any security benefit. Therefore we assume that the bugs cannot possibly constitute Independently Fixable Vulnerabilities in the sense of CVE CNA rule 4.2.11, but rather that this advisory is properly construed under the rules as describing a single Vulnerability.

Severity

  • CVSS Score: 2.7 / 10 (Low)
  • Vector String: 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

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Release Notes

kpdecker/jsdiff (diff)

v5.2.2

Compare Source

v5.2.1

Compare Source


Configuration

📅 Schedule: (UTC)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate
renovate Bot force-pushed the renovate/npm-diff-vulnerability branch from 013215b to 8c7cf22 Compare January 20, 2026 03:56
@renovate renovate Bot changed the title Update dependency diff to v8 [SECURITY] Update dependency diff to v5.2.2 [SECURITY] Jan 21, 2026
@renovate
renovate Bot force-pushed the renovate/npm-diff-vulnerability branch from 8c7cf22 to cdc2c86 Compare January 21, 2026 19:08
@renovate
renovate Bot force-pushed the renovate/npm-diff-vulnerability branch from cdc2c86 to c38de3a Compare February 3, 2026 19:45
@renovate
renovate Bot force-pushed the renovate/npm-diff-vulnerability branch from c38de3a to b1bf98c Compare February 13, 2026 20:14
@renovate
renovate Bot force-pushed the renovate/npm-diff-vulnerability branch 2 times, most recently from 0165f28 to 38ffb2d Compare March 14, 2026 17:21
@renovate
renovate Bot force-pushed the renovate/npm-diff-vulnerability branch from 38ffb2d to c1fd5ac Compare April 15, 2026 11:38
@renovate
renovate Bot force-pushed the renovate/npm-diff-vulnerability branch from c1fd5ac to c433ad6 Compare May 1, 2026 07:38
@renovate
renovate Bot force-pushed the renovate/npm-diff-vulnerability branch from c433ad6 to b6eef23 Compare May 13, 2026 20:14
@renovate
renovate Bot force-pushed the renovate/npm-diff-vulnerability branch from b6eef23 to 9d22292 Compare May 22, 2026 03:26
@renovate
renovate Bot force-pushed the renovate/npm-diff-vulnerability branch 2 times, most recently from e845a0c to 2714f9a Compare June 4, 2026 04:00
@renovate
renovate Bot force-pushed the renovate/npm-diff-vulnerability branch from 2714f9a to 192fd6f Compare June 12, 2026 14:44
@renovate
renovate Bot force-pushed the renovate/npm-diff-vulnerability branch from 192fd6f to 3948074 Compare July 18, 2026 00:05
@renovate
renovate Bot force-pushed the renovate/npm-diff-vulnerability branch from 3948074 to 10c4a7a Compare July 25, 2026 12:00
@renovate
renovate Bot force-pushed the renovate/npm-diff-vulnerability branch from 10c4a7a to 6067f9f Compare August 1, 2026 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants