packagist package report

Is twig/markdown-extra safe?

1 known vulnerability, worst severity LOW.

// reach

0 direct dependencies

none carry a known advisory

    0 packages depend on it

    dependents not yet indexed for this ecosystem

      Create a free accountfor every dependency path, dependent and what to upgrade
      // ai model usage

      Tracked for PyPI packages. HuggingFace models declare Python dependencies, so packagist packages are not covered.


      cvss
      5.1
      medium

      CVSS v4.0 base score out of 10; GitHub rates it LOW

      epss
      0.30%
      low

      chance of exploitation in 30 days, 23rd percentile of all CVEs

      xyz score
      1.1
      low

      CyberXYZ composite out of 10

      fig. 01 — GHSA-jv8m-2544-3pg3, the advisory selected below

      // 1 advisories

      GHSA-jv8m-2544-3pg3

      LOWGitHub ratingCVE-2026-46637
      // 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 <code>&lt;img src=x onerror=alert(1)&gt;</code> becomes `<img src=x onerror=alert(1)>`, 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 <script> 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 like to thank Claude Mythos Preview (via Project Glasswing) for reporting the issue and providing the fix for html_to_markdown and markdown_to_html in twig/markdown-extra, and Christophe Coevoet for extending the audit to inline_css in twig/cssinliner-extra.

      // cvss v4.0 vector

      CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N

      Attack vector
      Network
      Attack complexity
      Low
      Attack requirements
      None
      Privileges required
      Low
      User interaction
      Passive
      Confidentiality (vulnerable system)
      None
      Integrity (vulnerable system)
      None
      Availability (vulnerable system)
      None
      Confidentiality (subsequent systems)
      Low
      Integrity (subsequent systems)
      Low
      Availability (subsequent systems)
      None

      Checked 2026-11-07 at 22:36 UTC. The most recent advisory here was published 2026-05-21. Updated continuously from NVD, GHSA, OSV and CNA feeds.

      Think a verdict here is wrong? Tell us — we respond within 2 business days.