{"id":"CVE-2026-136268","aliases":["CVE-2026-136268","EEF-CVE-2026-136268"],"related":[],"kind":"vulnerability","state":"published","title":"Code block fence breakout in MDEx to_slack/2 allows Slack mention and link injection","summary":"Improper Neutralization of Escape, Meta, or Control Sequences vulnerability in leandrocp mdex allows Content Spoofing via code block content passed to MDEx.to_slack/2. An attacker who controls Markdown that an application converts to Slack mrkdwn can inject <!channel>, <!here> and <@user> mentions and links whose visible label differs from their target, with default options.\n\nIn lib/mdex/slack_converter.ex, the MDEx.CodeBlock clause of render_node/2 wraps the block's literal in a fixed three-backtick fence and emits it without the escaping applied to every other text node. A block opened with four backticks or tildes whose body contains a line of three backticks therefore closes the Slack code block early, and the rest of the body is parsed as live mrkdwn. Links injected this way also skip the dangerous URL filter in render_url/2.\n\nThis issue affects mdex: from 0.13.1 before 0.15.0.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Improper Neutralization of Escape, Meta, or Control Sequences vulnerability in leandrocp mdex allows Content Spoofing via code block content passed to MDEx.to_slack/2. An attacker who controls Markdown that an application converts to Slack mrkdwn can inject <!channel>, <!here> and <@user> mentions and links whose visible label differs from their target, with default options.\n\nIn lib/mdex/slack_converter.ex, the MDEx.CodeBlock clause of render_node/2 wraps the block's literal in a fixed three-backtick fence and emits it without the escaping applied to every other text node. A block opened with four backticks or tildes whose body contains a line of three backticks therefore closes the Slack code block early, and the rest of the body is parsed as live mrkdwn. Links injected this way also skip the dangerous URL filter in render_url/2.\n\nThis issue affects mdex: from 0.13.1 before 0.15.0.","source":"cvelist"},{"lang":"en","text":"## Summary\n\nImproper Neutralization of Escape, Meta, or Control Sequences vulnerability in leandrocp mdex allows Content Spoofing via code block content passed to `MDEx.to_slack/2`. An attacker who controls Markdown that an application converts to Slack mrkdwn can inject `<!channel>`, `<!here>` and `<@user>` mentions and links whose visible label differs from their target, with default options.\n\nIn `lib/mdex/slack_converter.ex`, the `MDEx.CodeBlock` clause of `render_node/2` wraps the block's literal in a fixed three-backtick fence and emits it without the escaping applied to every other text node. A block opened with four backticks or tildes whose body contains a line of three backticks therefore closes the Slack code block early, and the rest of the body is parsed as live mrkdwn. Links injected this way also skip the dangerous URL filter in `render_url/2`.\n\nThis issue affects mdex: from 0.13.1 before 0.15.0.\n\n## Details\n\n**1. Input handling.** `MDEx.to_slack/2` parses the Markdown and passes the document to `MDEx.SlackConverter.convert/2`, which renders each node. Text, inline code and link labels go through `escape_text/1`, which encodes `&`, `<` and `>`.\n\n**2. Unsafe processing.** The `MDEx.CodeBlock` clause of `render_node/2` emits the block literal unchanged between a fixed opening and closing three-backtick fence. CommonMark lets a block opened with four backticks or `~~~` contain a line of three backticks, so that line reaches the output intact.\n\n**3. Effect in Slack.** Slack ends a code block at the next three backticks, so the inner line closes the fence and the remaining body is parsed as mrkdwn. Mention tokens such as `<!channel>` and links such as `<https://evil.example|https://trusted.example>` become live, while the same text outside a code block is escaped. Injected links never pass through `render_url/2`, so its dangerous URL check does not apply.\n\n## Proof of concept\n\n1. Supply Markdown that opens a code block with four backticks, has a line of three backticks as its first body line, then the line `<!channel> <https://evil.example|https://trusted.example>`, and closes with four backticks.\n2. Convert it with `MDEx.to_slack/2` using default options.\n3. Observe that the output's code block ends at the inner three-backtick line and the following line keeps `<!channel>` and the label-spoofed link unescaped outside any code block, while a plain-text `<!channel>` elsewhere in the same input is escaped to `&lt;!channel&gt;`.\n\n## Impact\n\nAn attacker who can submit Markdown that an application forwards to Slack can trigger channel-wide or per-user notifications and post links whose visible label shows a trusted URL while pointing elsewhere, in messages that appear to come from the application.","format":"markdown","source":"eef"}],"published":"2026-11-30T18:43:53.309Z","modified":"2026-11-30T19:17:52.457Z","severity":{"scorer":"EEF","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:L/SA:N","score":5.1,"rating":"MEDIUM"},"severities":[{"scorer":"EEF","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:L/SA:N","score":5.1,"rating":"MEDIUM"},{"scorer":"Erlang Ecosystem Foundation","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:L/SA:N"}],"cwes":["CWE-150"],"affected":[{"ranges":[{"type":"semver","introduced":"0.13.1","fixed":"0.15.0","status":"affected"}],"vendor":"leandrocp","product":"mdex","package":"mdex","cpe":"cpe:2.3:a:leandrocp:mdex:*:*:*:*:*:*:*:*","repo":"https://github.com/leandrocp/mdex","source":"cvelist"},{"ranges":[{"type":"git","introduced":"0be090a78dbe587a90814a7481b039d10996863c","fixed":"22a0c7b6614f84648e72699f3e426f20b7f04ba6","status":"affected"}],"vendor":"leandrocp","product":"mdex","package":"leandrocp/mdex","cpe":"cpe:2.3:a:leandrocp:mdex:*:*:*:*:*:*:*:*","repo":"https://github.com/leandrocp/mdex","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0.13.1","status":"affected","fixed":"0.15.0"}],"ecosystem":"Hex","package":"mdex","purl":"pkg:hex/mdex","source":"eef"},{"ranges":[{"type":"git","introduced":"0be090a78dbe587a90814a7481b039d10996863c","status":"affected","fixed":"22a0c7b6614f84648e72699f3e426f20b7f04ba6"}],"repo":"https://github.com/leandrocp/mdex","source":"eef"}],"references":[{"url":"https://cna.erlef.org/cves/CVE-2026-136268.html","tags":["related","third-party-advisory","web"],"sources":["cvelist","eef","nvd"]},{"url":"https://osv.dev/vulnerability/EEF-CVE-2026-136268","tags":["related"],"sources":["cvelist","nvd"]},{"url":"https://github.com/leandrocp/mdex/commit/0be090a78dbe587a90814a7481b039d10996863c","tags":["related","web"],"sources":["cvelist","eef","nvd"]},{"url":"https://github.com/leandrocp/mdex/commit/22a0c7b6614f84648e72699f3e426f20b7f04ba6","tags":["fix","patch"],"sources":["cvelist","eef","nvd"]},{"url":"https://hex.pm/packages/mdex","tags":["package"],"sources":["eef"]}],"credits":["Peter Ullrich","Jonatan Männchen / EEF","Leandro Pereira"],"assigner":"EEF","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-136268","url":"https://www.cve.org/CVERecord?id=CVE-2026-136268","licence":"CVE Terms of Use","modified":"2026-11-30T18:43:53.309Z"},{"source":"eef","name":"Erlang Ecosystem Foundation","id":"EEF-CVE-2026-136268","url":"https://osv.dev/vulnerability/EEF-CVE-2026-136268","licence":"CC-BY-4.0","modified":"2026-11-30T18:45:05.765Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-136268","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-136268","licence":"Public domain","modified":"2026-11-30T19:17:52.457Z"}],"updatedAt":"2026-11-30T19:32:17.863Z","epss":{"score":0.00233,"percentile":0.1518,"date":"2026-12-01T12:00:22.000Z"}}