Technical impact
A memory management flaw in the native rendering engine of mdex and mdex_native leaks operating-system memory unboundedly whenever a document containing escaped-tag nodes is rendered. The error occurs because each %MDEx.EscapedTag{} node’s literal string is boxed and leaked, causing the allocation to persist for the lifetime of the BEAM process and never to be freed. Because the attacker controls both the byte length of each literal and the number of escaped-tag nodes, repeated or large renders can consume arbitrarily large amounts of RAM, eventually exhausting memory and crashing the runtime, which brings down all applications running in the same BEAM instance. The bug aligns with CWE-401 (Memory Leak) and results in a denial of service.
Affected Systems
The vulnerability is present in leandrocp's mdex package from version 0.11.1 up to (but not including) 0.12.3, and in the mdex_native package from version 0.1.0 up to (but not including) 0.2.3. Versions 0.12.3 of mdex and 0.2.3 of mdex_native contain the fix. Any application that uses these libraries to render documents derived from user input is affected.
Risk and Exploitability
The CVSS score of 6.9 indicates moderate severity, while the EPSS score is 0.0019 (approximately 0.19%) and the CVE is not listed in CISA’s KEV catalog. Based on the description, it is inferred that the likely attack vector is an attacker supplying a crafted MDEx document containing escaped-tag nodes to the public MDEx.to_html/1 API or any other rendering endpoint that accepts user data. An attacker only needs to supply a crafted MDEx document that includes escaped-tag nodes, which is possible through the public MDEx.to_html/1 API or any other rendering endpoint that accepts user data. Because there is no size or rate limiting on the rendering path, repeated or large documents can cause the process to consume memory without bound, leading to a crash. The attack can be performed remotely if the rendering service is exposed to external clients, or locally in any environment where the application processes untrusted content.