Read the docs

Unbounded converter cache in Twig markdown-extra exhausts memory

Priority LOW 13CWE-770Published · Updated

Key facts

Attack vector
Network
Privileges required
Low
User interaction
None
Attack complexity
Low
Attack requirements
Present
Impact type
Denial of service
Confidentiality · integrity · availability
None · None · Low
Fix status
Fixed

Attack profile from CVSS 4.0 · CNA. Fix status from CNA. Impact type from CWE-770.

Summary

The html_to_markdown filter of twig/markdown-extra keeps a static cache of HtmlConverter instances with no size limit, keyed on each distinct set of options passed to the filter. A template that passes options taken from input data, or a sandboxed template, can make the cache grow without limit (CWE-770). Because the cache outlives the Twig environment, it can exhaust memory in long-running worker processes. An attacker needs low privileges and can reach the filter through template input.

Written with Claude Haiku 5.5 from the sources below · 2026-11-24

Description from the CNA

The html_to_markdown filter of twig/markdown-extra keeps an HtmlConverter for each distinct mapping of options it receives. They're kept in a static array, with no size limit and no eviction. The options are an argument of the filter. A template that passes options taken from the input, or a sandboxed template, can therefore make this cache grow without limit. The cache outlives the environment, so it fills the memory of long-running workers. The cache now keeps at most 100 converters, like the formatter caches of IntlExtension.

Why it matters now

EPSS 0.00581 41st percentileScored 2026-11-30
Fix Fixed twig/markdown-extra (Twig): 3.31.1

SSVC decision points

Not available: CISA has not published SSVC decision points for this record.

Affected products

VendorProductAffected versionsFixed inStatusSource
Twigtwig/markdown-extrabefore 3.31.13.31.1Patch availableCNA
  • twig/markdown-extra VendorTwig Affected before 3.31.1 Fixed in 3.31.1 Patch available CNA

Remediation

Upgrade twig/markdown-extra to version 3.31.1, which caps the cache at 100 converters.

Written with Claude Haiku 5.5 from the sources below · 2026-11-24

  • Fix · CNA twig/markdown-extra (Twig) Fixed in 3.31.1

Timeline

  1. 2026-11-24 Threatist record created from CVE-2026-133773

References

  • TI-2026-97282 Sandbox bypass in Twig join filter exposes object properties CVSS 4.0MEDIUM 5.3
  • TI-2026-97281 Twig sandbox bypass through dynamic embed parent expressions CVSS 4.0MEDIUM 5.3
  • TI-2026-97279 Sandbox toString() policy bypass in Twig via assignments CVSS 4.0MEDIUM 5.3
  • TI-2026-97277 Sandbox toString policy bypass via is true test in Twig CVSS 4.0MEDIUM 5.3
  • TI-2026-97286 Sandbox bypass in Twig guard tag lets templates use disallowed tags CVSS 4.0LOW 2.3
  • TI-2026-97285 Twig skips autoescaping for variables named like import aliases CVSS 4.0LOW 2.3
See all 10 →

Sources

This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences