jsdiff has a Denial of Service vulnerability in parsePatch and applyPatch

オープン
#1,617 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
javascript
領域
security

調査の方向性

まず、npm パッケージ diff に対する BackstopJS の依存関係宣言を確認し、インストールされているバージョンを確認します。parsePatch と applyPatch の脆弱性の詳細を確認したうえで、依存関係が少なくとも 8.0.3 であり、プロジェクトの関連するテストが引き続きパスすることを検証します。

索引モデルが issue の本文から書いたものです。

説明

Security Vulnerability: Denial of Service (DoS) in jsdiff

Vulnerability Overview

A vulnerability has been identified in jsdiff where certain line break characters can lead to an infinite loop and potential memory exhaustion.

Detail Description
Package diff (npm: jsdiff)
Affected Versions < 8.0.3
Patched Version 8.0.3

Impact

The parsePatch method is vulnerable to an infinite loop when processing filename headers containing specific line break characters: \r, \u2028, or \u2029.

Key risks:

  • Memory Exhaustion: The process will consume memory indefinitely until it crashes (Out of Memory).
  • Denial of Service (DoS): Attackers can trigger this with a very small payload; size limits on user input do not provide protection.
  • Affected Methods: Both parsePatch and applyPatch (when used with string inputs) are affected.
  • Secondary Issue: A lesser ReDOS (Regular Expression Denial of Service) exists in the patch header parsing, which can lead to $O(n^3)$ time complexity.

Patches

✅ All identified vulnerabilities have been fixed in v8.0.3.

Users are strongly encouraged to upgrade as soon as possible:

npm install [email protected]

See: https://github.com/kpdecker/jsdiff/pull/649

主要言語
JavaScript
スター
7.2k
フォーク
617
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

garris/BackstopJS のほかの issue

garris/BackstopJS の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。