WizがGoogle Cloudに参加:共に魔法を作り出す

CVE-2026-140010: 
JavaScript 脆弱性分析と緩和策

概要

CVE-2026-140010 is a Regular Expression Denial of Service (ReDoS) vulnerability in the minify() function of HTML Minifier Next and its predecessor HTML Minifier. The flaw stems from ambiguous regular expressions (RE_LAST_HTML_TAG and a whitespace-splitting variant) that cause quadratic backtracking when processing attacker-controlled HTML content. Affected versions include html-minifier-next prior to 9.1.2 and html-minifier from 3.1.1 up to (but not including) 5.0.1. It was published on November 30, 2026, and carries a CVSS v4.0 base score of 8.7 (High) (GitHub Advisory).

技術的詳細

The root cause is classified as CWE-1333 (Inefficient Regular Expression Complexity), mapped to CAPEC-492 (Regular Expression Exponential Blowup). Two problematic expressions exist in src/htmlminifier.js: RE_LAST_HTML_TAG = /[\s\S]*<(\/?[a-zA-Z][\w:-]*)/ (line 691) and /^(\s*)[\s\S]?(\s)$/ (line 1279). The greedy [\s\S]* prefix followed by a required literal < forces the regex engine to retry at every character boundary when no < is present, producing O(n²) work. The RE_LAST_HTML_TAG variant is triggered when collapseWhitespace is enabled and a large htmlmin:ignore block (with no matching closing tag) is followed by a real HTML element; the whitespace-splitting variant is triggered independently by a long whitespace run inside a default ignoreCustomFragments match. User-controlled HTML content flows directly into these regex evaluations with no length pre-check (GitHub Advisory, Fix Commit).

影響

Successful exploitation causes severe CPU exhaustion on the server running the minifier: a 256 KB malicious payload can block a Node.js process for approximately 89 seconds, with complexity scaling quadratically (128 KB ≈ 16.5 s, 64 KB ≈ 1.5 s). In web service or API contexts, a small number of concurrent malicious requests can exhaust the event loop and CPU, rendering the service unavailable. The attack surface is broad — any application that passes untrusted HTML to minify() with collapseWhitespace enabled is affected, including CMS platforms, comment systems, email template renderers, online HTML optimization tools, and CI/CD build pipelines. There is no confidentiality or integrity impact; the sole consequence is availability loss (GitHub Advisory).

利用可能性

No public proof-of-concept exploit code has been observed, and there is no evidence of in-the-wild exploitation at the time of disclosure. The EPSS score is 0.0, and the vulnerability is not listed in the CISA Known Exploited Vulnerabilities catalog. However, the attack requires no authentication, no special privileges, and no user interaction — an attacker only needs the ability to submit HTML content that is subsequently processed by the minifier. The advisory itself includes a detailed PoC script (e2e_htmlmin2.mjs) demonstrating the quadratic timing behavior, lowering the barrier for exploitation (GitHub Advisory).

エクスプロイテーションのステップ

  1. Identify target: Locate a web application or API endpoint that accepts user-supplied HTML and processes it through html-minifier-next (< 9.1.2) or html-minifier (3.1.1–5.0.0) with collapseWhitespace: true enabled.
  2. Craft ReDoS payload (RE_LAST_HTML_TAG variant): Construct an HTML document containing a large htmlmin:ignore block filled with characters that contain no <, followed by a real HTML element. Example structure: <htmlmin:ignore> + 'a'.repeat(256000) + </htmlmin:ignore> + <b>y</b>.
  3. Craft ReDoS payload (whitespace-splitting variant): Alternatively, embed a long whitespace run inside a default ignoreCustomFragments match (e.g., inside a <!-- ... --> or <% ... %> block) to trigger the /^(\s*)[\s\S]?(\s)$/ expression.
  4. Submit payload: Send the crafted HTML to the target endpoint (e.g., via HTTP POST to a form, API, or content submission interface).
  5. Achieve denial of service: The minify() call enters quadratic backtracking, occupying a CPU core for seconds to minutes per request. Sending a small number of concurrent requests exhausts server CPU, causing service unavailability (GitHub Advisory).

妥協の兆候

  • Process: Node.js process exhibiting sustained near-100% CPU utilization on a single core for extended periods (seconds to minutes) during HTML processing operations.
  • Logs: Application logs showing unusually long response times or timeouts on endpoints that invoke minify(); event loop lag alerts in Node.js APM tools.
  • Network: Repeated HTTP requests to content submission or HTML processing endpoints containing large htmlmin:ignore blocks or payloads with long whitespace runs in comment or template tag fragments.
  • File System: Presence of html-minifier-next versions ≤ 9.1.1 or html-minifier versions 3.1.1–5.0.0 in node_modules/ (check package-lock.json or npm list html-minifier-next html-minifier).

緩和策と回避策

The primary remediation is to upgrade to html-minifier-next version 9.1.2 or later, or html-minifier version 5.0.1 or later, which replace the ambiguous regular expressions with linear-time equivalents (Fix Commit). If immediate patching is not possible, the following workarounds can reduce risk: disable the collapseWhitespace option to prevent the RE_LAST_HTML_TAG code path from being reached; implement input validation to reject or truncate HTML inputs exceeding a safe length threshold before passing them to minify(); and enforce per-request CPU time limits or timeouts on the minification process. Running the minifier in a worker thread with a timeout can also limit the blast radius of a successful attack (GitHub Advisory).

追加リソース


ソース: この報告書はAIを用いて作成されました

関連 JavaScript 脆弱性:

CVE ID

重大度

スコア

テクノロジー

コンポーネント名

CISA KEVのエクスプロイト

修正あり

出版日

CVE-2026-140097CRITICAL9.1
  • JavaScript logoJavaScript
  • vite
いいえはいNov 30, 2026
CVE-2026-140010HIGH8.7
  • JavaScript logoJavaScript
  • html-minifier
いいえはいNov 30, 2026
CVE-2026-140008HIGH8.7
  • JavaScript logoJavaScript
  • minimatch
いいえはいNov 30, 2026
CVE-2026-140102HIGH7.5
  • JavaScript logoJavaScript
  • http-proxy-middleware
いいえいいえNov 30, 2026
CVE-2026-140103MEDIUM5.4
  • JavaScript logoJavaScript
  • http-proxy-middleware
いいえはいNov 30, 2026

無料脆弱性評価

クラウドセキュリティの姿勢をベンチマークしましょう

9つのセキュリティ領域にわたるクラウドセキュリティの実践を評価し、リスクレベルをベンチマークし、防御のギャップを特定しましょう。

評価のリクエスト

Wizのその他のリソース

パーソナライズされたデモを見る

実際に Wiz を見てみませんか?​

"私が今まで見た中で最高のユーザーエクスペリエンスは、クラウドワークロードを完全に可視化します。"
デビッド・エストリックCISO (最高情報責任者)
"Wiz を使えば、クラウド環境で何が起こっているかを 1 つの画面で確認することができます"
アダム・フレッチャーチーフ・セキュリティ・オフィサー
"Wizが何かを重要視した場合、それは実際に重要であることを私たちは知っています。"
グレッグ・ポニャトフスキ脅威および脆弱性管理責任者