{"id":"EEF-CVE-2026-53429","summary":"Unbounded native memory leak in mdex escaped-tag rendering enables unauthenticated denial of service","details":"## Summary\n\nMissing Release of Memory after Effective Lifetime vulnerability in leandrocp mdex and mdex_native allows an attacker who controls a rendered document to cause a denial of service through unbounded native memory exhaustion.\n\nThe native rendering code permanently leaks memory when rendering a document that contains escaped-tag nodes. The conversion of each `%MDEx.EscapedTag{}` node into its native representation (`From\u003cExEscapedTag\u003e for NodeValue` in the Rust NIF) calls `Box::leak` on the caller-supplied `literal` string, which surrenders the backing allocation so that it lives for the entire lifetime of the operating system process and is never freed.\n\nBoth the byte length of each literal and the number of escaped-tag nodes in a document are attacker-controlled, and there is no size cap, rate limit, or string interning on this path. Every render of a document containing escaped-tag nodes therefore leaks `literal_size × node_count` bytes that can never be reclaimed, and repeated renders accumulate without bound. Rendering reaches this path through the public `MDEx.to_html/1` entry point and any other API that renders a supplied `%MDEx.Document{}`.\n\nAny application that uses `mdex` (or `mdex_native` directly) to render documents derived from user-supplied content is affected. Because the leaked memory is never reclaimed for the life of the BEAM process, an attacker can drive resident memory upward without limit until the node exhausts memory and crashes, taking down every process on it.\n\nThe vulnerable native code originally shipped inside `mdex` (in `native/comrak_nif/src/types/document.rs`) and was later extracted into the separate `mdex_native` package (`native/mdex_native_nif/src/types/document.rs`).\n\nThis issue affects mdex: from 0.11.1 before 0.12.3; mdex_native: from 0.1.0 before 0.2.3.","aliases":["CVE-2026-53429","GHSA-cmvp-gp9f-23xw"],"modified":"2026-11-26T17:23:06.143458956Z","published":"2026-06-29T19:07:16.954Z","database_specific":{"cpe_ids":["cpe:2.3:a:leandrocp:mdex:*:*:*:*:*:*:*:*","cpe:2.3:a:leandrocp:mdex_native:*:*:*:*:*:*:*:*"],"cwe_ids":["CWE-401"],"$schema":"https://cna.erlef.org/schemas/osv/record-0.1.0.json","capec_ids":["CAPEC-130"]},"references":[{"type":"ADVISORY","url":"https://github.com/leandrocp/mdex_native/security/advisories/GHSA-cmvp-gp9f-23xw"},{"type":"WEB","url":"https://cna.erlef.org/cves/CVE-2026-53429.html"},{"type":"WEB","url":"https://github.com/leandrocp/mdex/commit/81e4d14dd3aa5b206e395c7f372b9b413793015f"},{"type":"FIX","url":"https://github.com/leandrocp/mdex/commit/6ed94d905f97af188323f042698ae841c02293b4"},{"type":"WEB","url":"https://github.com/leandrocp/mdex_native/commit/956528c5e31746253347029e810a969ab916fd27"},{"type":"FIX","url":"https://github.com/leandrocp/mdex_native/commit/cbd927fb5061b488de8d90a8ef6df65718ca1fe6"},{"type":"PACKAGE","url":"https://hex.pm/packages/mdex"},{"type":"PACKAGE","url":"https://hex.pm/packages/mdex_native"}],"affected":[{"package":{"name":"mdex","ecosystem":"Hex","purl":"pkg:hex/mdex"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0.11.1"},{"fixed":"0.12.3"}]}],"versions":["0.11.1","0.11.2","0.11.3","0.11.4","0.11.5","0.11.6","0.11.7","0.12.0","0.12.1","0.12.2"],"ecosystem_specific":{"program_routines":["comrak_nif::document_to_html_with_options","'Elixir.MDEx.Native':document_to_html_with_options/2","'Elixir.MDEx':to_html/1"],"$schema":"https://cna.erlef.org/schemas/osv/affected-0.1.0.json","modules":["'Elixir.MDEx'","comrak_nif"],"program_files":["native/comrak_nif/src/types/document.rs"]},"database_specific":{"$schema":"https://cna.erlef.org/schemas/osv/affected-0.1.0.json","modules":["'Elixir.MDEx'","comrak_nif"],"program_files":["native/comrak_nif/src/types/document.rs"],"program_routines":["comrak_nif::document_to_html_with_options","'Elixir.MDEx.Native':document_to_html_with_options/2","'Elixir.MDEx':to_html/1"],"source":"https://cna.erlef.org/osv/EEF-CVE-2026-53429.json"}},{"package":{"name":"mdex_native","ecosystem":"Hex","purl":"pkg:hex/mdex_native"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0.1.0"},{"fixed":"0.2.3"}]}],"versions":["0.1.0","0.1.1","0.1.2","0.1.3","0.1.4","0.1.5","0.2.0","0.2.1","0.2.2"],"ecosystem_specific":{"program_files":["native/mdex_native_nif/src/types/document.rs"],"program_routines":["mdex_native_nif::document_to_html_with_options","'Elixir.MDExNative.Native':document_to_html_with_options/2","'Elixir.MDExNative.Comrak':document_to_html/2"],"$schema":"https://cna.erlef.org/schemas/osv/affected-0.1.0.json","modules":["'Elixir.MDExNative.Comrak'","mdex_native_nif"]},"database_specific":{"program_files":["native/mdex_native_nif/src/types/document.rs"],"program_routines":["mdex_native_nif::document_to_html_with_options","'Elixir.MDExNative.Native':document_to_html_with_options/2","'Elixir.MDExNative.Comrak':document_to_html/2"],"source":"https://cna.erlef.org/osv/EEF-CVE-2026-53429.json","$schema":"https://cna.erlef.org/schemas/osv/affected-0.1.0.json","modules":["'Elixir.MDExNative.Comrak'","mdex_native_nif"]}},{"ranges":[{"type":"GIT","repo":"https://github.com/leandrocp/mdex","events":[{"introduced":"81e4d14dd3aa5b206e395c7f372b9b413793015f"},{"fixed":"6ed94d905f97af188323f042698ae841c02293b4"}]}],"versions":["v0.12.2","v0.12.1","v0.12.0","v0.11.7","v0.11.6","v0.11.5","v0.11.4","v0.11.3","v0.11.2","v0.11.1"],"database_specific":{"program_routines":["comrak_nif::document_to_html_with_options","'Elixir.MDEx.Native':document_to_html_with_options/2","'Elixir.MDEx':to_html/1"],"source":"https://cna.erlef.org/osv/EEF-CVE-2026-53429.json","$schema":"https://cna.erlef.org/schemas/osv/affected-0.1.0.json","modules":["'Elixir.MDEx'","comrak_nif"],"program_files":["native/comrak_nif/src/types/document.rs"]}},{"ranges":[{"type":"GIT","repo":"https://github.com/leandrocp/mdex_native","events":[{"introduced":"956528c5e31746253347029e810a969ab916fd27"},{"fixed":"cbd927fb5061b488de8d90a8ef6df65718ca1fe6"}]}],"versions":["v0.2.2","v0.2.1","v0.2.0","v0.1.5","v0.1.4","v0.1.3","v0.1.2","v0.1.1"],"database_specific":{"$schema":"https://cna.erlef.org/schemas/osv/affected-0.1.0.json","modules":["'Elixir.MDExNative.Comrak'","mdex_native_nif"],"program_files":["native/mdex_native_nif/src/types/document.rs"],"program_routines":["mdex_native_nif::document_to_html_with_options","'Elixir.MDExNative.Native':document_to_html_with_options/2","'Elixir.MDExNative.Comrak':document_to_html/2"],"source":"https://cna.erlef.org/osv/EEF-CVE-2026-53429.json"}}],"schema_version":"1.9.2","severity":[{"type":"CVSS_V4","score":"CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N","source":"CNA"}],"credits":[{"name":"Peter Ullrich","type":"FINDER"},{"name":"Jonatan Männchen / EEF","type":"ANALYST"},{"name":"Leandro Pereira","type":"REMEDIATION_DEVELOPER"}]}