CVE-2026-136129: Dangerous URL filter bypass via control characters in MDEx Quill Delta output (XSS)

Published Nov 30, 2026
·
Updated

Summary

Incorrect Behavior Order: Validate Before Canonicalize vulnerability in leandrocp mdex allows an attacker who controls Markdown input to place javascript: and data: URLs into Quill Delta output via entity-encoded control characters.

MDEx.todelta/2 blanks link, wikilink and image URLs that its dangerous-URL check flags, but renderurl/2 in lib/mdex/deltaconverter.ex runs that prefix check on the entity-decoded URL without first normalizing it as a browser would. A destination such as java	script:alert(1) reaches the check with a tab inside the scheme, passes, and is emitted unchanged. Browsers remove tab, carriage return and line feed and trim leading C0 control characters and spaces when parsing a URL, so the value runs as javascript:. Only applications that place the Delta link or image value into an href or src without their own URL check are exposed. Stock Quill re-sanitizes link protocols and is not affected.

This issue affects mdex: from 0.13.2 before 0.15.0.

Details

1. Entity decoding. Comrak decodes HTML entities in link and image destinations while parsing, so java	script:alert(1) becomes the URL java, a tab, script:alert(1). The 	 and 
 named entities, a leading  or  , data	: and reference-style definitions behave the same way.

2. Unnormalized check. renderurl/2 in lib/mdex/deltaconverter.ex asks MDExNative.Comrak.dangerousurl?/1 whether the URL is dangerous. That function is a plain prefix match on javascript:, vbscript:, file: and data:, so the decoded value does not match and is returned unchanged. A plain javascript: URL is still blanked.

3. Emission. The Link, Image and WikiLink clauses of defaultconvertnode/3 write the value into the Delta link or image attribute. The HTML renderer is not affected because it also percent-encodes URLs; the Delta path has no such step.

4. Browser normalization. WHATWG URL parsing strips ASCII tab, line feed and carriage return anywhere and trims leading C0 controls and spaces, so a consumer that writes the value into href produces a working javascript: link.

Proof of concept

1. Convert plain) tab) !img) lead) with MDEx.todelta/2 and default options. 2. Observe that the plain link is emitted as an empty string, while the other three are emitted as java\tscript:alert(1), java\nscript:alert(2) and a value starting with byte 1 followed by javascript:alert(3). 3. Place the tab link value into an <a href> and click it: the browser strips the tab and runs javascript:alert(1).

Impact

An attacker who can submit Markdown gets a stored javascript: or data: link into the Delta output, which runs script in the browser of a user who clicks it in an application that renders the Delta without its own URL check.

Configurations

The application must pass untrusted Markdown to MDEx.todelta/2 without the unsafe option and render the resulting Delta with a consumer (for example a custom Delta to HTML renderer or a non-Quill editor) that maps the link and image values to href and src without applying its own URL scheme check.

Other sources

Incorrect Behavior Order: Validate Before Canonicalize vulnerability in leandrocp mdex allows an attacker who controls Markdown input to place javascript: and data: URLs into Quill Delta output via entity-encoded control characters.

MDEx.todelta/2 blanks link, wikilink and image URLs that its dangerous-URL check flags, but renderurl/2 in lib/mdex/deltaconverter.ex runs that prefix check on the entity-decoded URL without first normalizing it as a browser would. A destination such as java&#9;script:alert(1) reaches the check with a tab inside the scheme, passes, and is emitted unchanged. Browsers remove tab, carriage return and line feed and trim leading C0 control characters and spaces when parsing a URL, so the value runs as javascript:. Only applications that place the Delta link or image value into an href or src without their own URL check are exposed. Stock Quill re-sanitizes link protocols and is not affected.

This issue affects mdex: from 0.13.2 before 0.15.0.

— MITRE

Affected Software

2 affected componentsFixes available
hex/mdex>=0.13.2<0.15.0
erlang/mdex>=0.13.2<0.15.0
0.15.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade erlang/mdex to a version that resolves this vulnerability.

    Fixed in 0.15.0
  2. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 0.15.0

Event History

Nov 30, 2026
CVE Published
via MITRE·06:44 PM
Data Sourced
via MITRE·06:44 PM
DescriptionWeakness
Data Sourced
via OSV·06:44 PM
DescriptionSeverityWeakness
Data Sourced
via OSV·06:45 PM
Affected Software
Data Sourced
via NVD·07:17 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Which applications are actually exposed to XSS from this issue?

Applications are exposed only if they accept attacker-controlled Markdown, convert it with MDEx.to_delta/2, and place Delta link or image values into href or src attributes without performing their own URL validation. Stock Quill re-sanitizes link protocols and is not affected.

2

What input is needed to bypass the dangerous-URL filter?

An attacker needs control over Markdown input and can use entity-encoded control characters within a dangerous scheme, such as java&#9;script:alert(1). The filter evaluates the decoded value before browser URL normalization, while browsers remove tabs, carriage returns, line feeds, and leading C0 controls or spaces during URL parsing.

3

Which MDEx versions are affected?

MDEx versions from 0.13.2 before 0.15.0 are affected.

4

What can be done if upgrading is not immediately possible?

Do not directly trust link, wikilink, or image URL values in MDEx Delta output. Validate and normalize URL values before placing them in href or src attributes, and reject dangerous protocols such as javascript: and data: after normalization.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203