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.
In 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.
This issue affects mdex: from 0.13.1 before 0.15.0.
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 >.
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.
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.
<!channel> <https://evil.example|https://trusted.example>, and closes with four backticks.MDEx.to_slack/2 using default options.<!channel> and the label-spoofed link unescaped outside any code block, while a plain-text <!channel> elsewhere in the same input is escaped to <!channel>.An 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.
{
"$schema": "https://cna.erlef.org/schemas/osv/record-0.1.0.json",
"capec_ids": [
"CAPEC-148"
],
"cpe_ids": [
"cpe:2.3:a:leandrocp:mdex:*:*:*:*:*:*:*:*"
],
"cwe_ids": [
"CWE-150"
]
}{
"$schema": "https://cna.erlef.org/schemas/osv/affected-0.1.0.json",
"modules": [
"'Elixir.MDEx.SlackConverter'",
"'Elixir.MDEx'"
],
"program_files": [
"lib/mdex/slack_converter.ex",
"lib/mdex.ex"
],
"program_routines": [
"'Elixir.MDEx.SlackConverter':convert/2",
"'Elixir.MDEx':to_slack/2",
"'Elixir.MDEx':to_slack!/2"
]
}
"https://cna.erlef.org/schemas/osv/affected-0.1.0.json"
[
"'Elixir.MDEx.SlackConverter'",
"'Elixir.MDEx'"
]
[
"lib/mdex/slack_converter.ex",
"lib/mdex.ex"
]
[
"'Elixir.MDEx.SlackConverter':convert/2",
"'Elixir.MDEx':to_slack/2",
"'Elixir.MDEx':to_slack!/2"
]
"https://cna.erlef.org/osv/EEF-CVE-2026-136268.json"
"https://cna.erlef.org/schemas/osv/affected-0.1.0.json"
[
"'Elixir.MDEx.SlackConverter'",
"'Elixir.MDEx'"
]
[
"lib/mdex/slack_converter.ex",
"lib/mdex.ex"
]
[
"'Elixir.MDEx.SlackConverter':convert/2",
"'Elixir.MDEx':to_slack/2",
"'Elixir.MDEx':to_slack!/2"
]
"https://cna.erlef.org/osv/EEF-CVE-2026-136268.json"