CVE-2026-136268
JSON

5.1medium

Code block fence breakout in MDEx to_slack/2 allows Slack mention and link injection

Severity
5.1medium CVSS:4.0 by EEF
Exploit likelihood
0.23% (higher than 15% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
EEF
Also known as
EEF-CVE-2026-136268

Description

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.

Affected

Product or packageVersionsReported by
mdexfrom 0.13.1 before 0.15.0CVE List
leandrocp/mdexfrom 0be090a78dbe587a90814a7481b039d10996863c before 22a0c7b6614f84648e72699f3e426f20b7f04ba6CVE List
mdex (Hex)from 0.13.1 before 0.15.0Erlang Ecosystem Foundation
https://github.com/leandrocp/mdexfrom 0be090a78dbe587a90814a7481b039d10996863c before 22a0c7b6614f84648e72699f3e426f20b7f04ba6Erlang Ecosystem Foundation

All scores

EEF5.1medium CVSS:4.0CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:L/SA:N
Erlang Ecosystem FoundationNot scored CVSS:4.0CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:L/SA:N

Classification

What each source says

CVE List

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.

Erlang Ecosystem Foundation

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.

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.

Details

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.

Proof of concept

  1. 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.
  2. Convert it with MDEx.to_slack/2 using default options.
  3. 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;.

Impact

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.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-136268 changed 2026-11-30CVE Terms of Use
Erlang Ecosystem FoundationEEF-CVE-2026-136268 changed 2026-11-30CC-BY-4.0
NVDCVE-2026-136268 changed 2026-11-30Public domain