CVE-2026-136268: Code block fence breakout in MDEx to_slack/2 allows Slack mention and link injection
Improper Neutralization of Escape, Meta, or Control Sequences vulnerability in leandrocp mdex allows Content Spoofing via code block content passed to MDEx.toslack/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.
In lib/mdex/slackconverter.ex, the MDEx.CodeBlock clause of rendernode/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 renderurl/2.
This issue affects mdex: from 0.13.1 before 0.15.0.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
mdexto a version that resolves this vulnerability.Fixed in 0.15.0
Event History
Frequently Asked Questions
Which applications are exposed to this issue?
Applications using mdex versions 0.13.1 through versions before 0.15.0 are affected when they pass attacker-controlled Markdown to MDEx.to_slack/2. The vulnerable behavior occurs with default options.
What must an attacker control to exploit it?
The attacker must be able to supply Markdown that the application converts into Slack mrkdwn with MDEx.to_slack/2. A code block opened with four backticks or tildes can include a line containing three backticks, ending the generated Slack code fence early and causing following content to be interpreted as live mrkdwn.
What can the injected Slack content do?
It can inject <!channel>, <!here>, and <@user> mentions, potentially notifying users or channels. It can also inject links whose displayed label differs from their destination, and those links bypass the dangerous URL filtering applied by render_url/2.
How can I determine whether my deployment is affected?
Check whether your dependency version is at least 0.13.1 and earlier than 0.15.0, and whether untrusted Markdown is converted through MDEx.to_slack/2. Testing a four-backtick or tilde-delimited code block containing a standalone three-backtick line can reveal whether content after that line is emitted as active Slack mrkdwn.