# GHSA-CXP7-29FV-2J25: Unbounded Converter Memoisation in twig/markdown-extra Keyed on Template-Controlled Options

- Database: GitHub
- Severity: CVSS 2.3 (Low)
- Published: 2026-11-24
- Modified: 2026-11-24

## Tracked as

- [CVE-2026-133773](https://cve.now/CVE-2026-133773.md): Twig Markdown Extra denial of service in html\_to\_markdown filter

## Affected versions

- twig/markdown-extra (Packagist): fixed in 3.31.1

## Description

### Description

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.

### Resolution

The cache now keeps at most 100 converters, like the formatter caches of `IntlExtension`.

The patch for this issue is available [here](https://github.com/twigphp/Twig/commit/6f9962f230425da39e970023a322d641c9089035) for branch 3.x.

### Credits

We would like to thank Nicolas Grekas for reporting the issue.

## References

- https://github.com/twigphp/Twig/security/advisories/GHSA-cxp7-29fv-2j25

Page: https://cve.now/GHSA-CXP7-29FV-2J25

Wrong or missing data? Send feedback: POST https://cve.now/api/v1/feedback (see https://cve.now/agents#feedback).
