English version →
カテゴリ
CVE-2026-46637 medium CVSS 5.4

twig/markdown-extra の脆弱性 (CVE-2026-46637)

概要

twig/markdown-extra に 脆弱性 (CVE-2026-46637) が存在。不正な操作・情報露出のリスクがあります。html 経由で攻撃可能。対策: 3.26.0 以上に更新。

原文の説明

取得元が公開している説明をそのまま載せています (多くは英語)。

Description

Several filters in the twig/* extras packages are registered with is_safe => ['all'], which tells Twig's autoescaper to treat their output as safe in every context (html, js, css, url, ...). The output of these filters is plain text or HTML markup, neither of which is safe in every escaping context.

Affected filters:

  • html_to_markdown (twig/markdown-extra) emits plain Markdown text. league/html-to-markdown decodes HTML entities when producing code spans and fenced blocks, so an attacker-controlled <img src=x onerror=alert(1)> becomes ``, which renders live when interpolated into an HTML page.
  • markdown_to_html (twig/markdown-extra) emits HTML. Safe in an HTML context but not in JS, CSS or URL contexts (e.g. when interpolated into an inline `` block).
  • inline_css (twig/cssinliner-extra) emits HTML with inlined styles. Same constraint as markdown_to_html.

In all three cases, is_safe => ['all'] causes the autoescaper to emit the output verbatim in any context, even when the developer never wrote |raw. In a context such as a JS string or a URL parameter, this produces unescaped HTML and is exploitable as XSS.

Resolution

  • html_to_markdown no longer claims to be safe in any escaping context; its plain-text output is now autoescaped for the surrounding context.
  • markdown_to_html and inline_css are now declared is_safe => ['html'], asserting only what they actually guarantee.

Credits

Twig would…

出典: GitHub Security Advisories (Global) NVD GitHub Advisory

自動生成の要約

取得元のデータ (CVSS・CWE・影響バージョンなど) から SecPulse が定型文で組み立てた要約です。AI は使っていません。正確な内容は下の原文と参照URLで確認してください。

twig/markdown-extra という製品で、CVE-2026-46637 という番号がついた弱点 (脆弱性) が見つかりました。
悪い人がインターネット越しに html のような特定の入り口を狙うことで、製品の中を不正に操作できてしまいます。
不正な操作・情報露出のリスクがあります。重要度は CVSS スコア 5.4/10 です。
対策: twig/markdown-extra を 3.26.0 以上に更新してください。
心配なら、システム担当者や製品の公式サイトで「twig/markdown-extra CVE-2026-46637」を検索してください。

CVE-2026-46637 (twig/markdown-extra) — CWE-116 / CVSS v3 5.4
攻撃ベクター: ネットワーク経由 (リモート攻撃可)
脆弱箇所: html / css / url / html_to_markdown
修正バージョン: 3.26.0 (即時適用推奨)
対応方針: 1) SBOMで影響バージョン横断確認, 2) ステージング検証→本番更新, 3) WAF/プロキシで該当エンドポイントを監視, 4) ログでIOC調査。
参考: 当ページの『参照URL』の GHSA / vendor advisory / patched release を参照。

❓ 何が問題か

twig/markdown-extra に 脆弱性 (CWE-116) があります。攻撃者は html を経由して脆弱な処理に到達できます。

📍 影響範囲

twig/markdown-extra の影響バージョンはベンダーのアドバイザリで確認してください。攻撃箇所: html / css / url / html_to_markdown。

🔥 重要度

重要度: 中 (CVSS 5.4/10)。不正な操作・情報露出のリスクがあります。

🔧 修正方法

3.26.0 に更新してください。

🛡️ 暫定回避

修正版が未提供時は、影響機能の無効化・WAFルール・ネットワークACLでの遮断を検討。

🔍 検知方法

Webサーバ・プロキシ・WAFログで該当CVEのIOCに合致する不審リクエストを検索。SBOM/依存ファイルで影響バージョンを横断確認。

対応アクション

SOC/SREチームが順番に実行すべき具体的なステップとコマンド例

  1. 1
    影響範囲の特定 identify
    grep -r 'twig/markdown-extra' . | grep -v node_modules

    リポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で twig/markdown-extra を grep し、稼働しているサービス・バージョンを把握する。

  2. 2
    パッチ適用 patch
    Upgrade twig/markdown-extra to 3.26.0

    ステージング環境で 3.26.0 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスを含めること。

  3. 3
    事後検証 verify
    Confirm patched version is live in production

    パッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番ではアクセスログ・WAF でアラート再発が無いか継続監視。

影響パッケージ

composer twig/markdown-extra
[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.26.0"}]}]
composer twig/cssinliner-extra
[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.26.0"}]}]
Packagist twig/markdown-extra
[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.26.0"}]}]
Packagist twig/cssinliner-extra
[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"3.26.0"}]}]

ディストリビューション別の修正状況

各ディストリビューションが公開している、この CVE の修正パッケージ

参照URL

当サイトでは、アクセス解析と広告の効果測定のために Cookie を使います。株式会社Game のサイト共通の設定です。 詳しく