CVE-2026-53427: MDEx Cross-Site Scripting Vulnerability via Unescaped Highlight Lines Class

mdex Updated 30 Jun 2026

Summary

29/06/2026
Yes i
Low
2.3

CVE-2026-53427: Cross-site scripting in MDEx via unescaped highlight_lines_class code-fence attribute. Affects mdex across 3 version ranges.

>= 0.11.3, < 0.12.3 >= 0d7ffc84ea742e1daf666426814e5bb6d0499433, < 6ed94d905f97af188323f042698ae841c02293b4 >= 956528c5e31746253347029e810a969ab916fd27, < 798a363b4339f6f7162ec8437c4c9f9b5ae6fbf3

Fixed in 0.12.3. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

MDEx is a Markdown rendering library that supports syntax highlighting and various formatting options. It is widely used for rendering user-generated content in applications such as comments, posts, and documentation. The library allows for customization through attributes, but this flexibility can lead to security vulnerabilities if not properly managed.

Vulnerability Detail

The vulnerability arises from improper neutralization of input during web page generation, specifically in the handling of the highlight_lines_class attribute within code fences. When the Lumis adapter processes Markdown with full info-string forwarding enabled, it copies the value of the highlight_lines_class attribute directly into the class attribute of rendered lines without escaping it. This allows an attacker to inject arbitrary HTML and JavaScript, which can execute in the browsers of users viewing the content, leading to session theft and account takeover. The vulnerability affects versions of MDEx from 0.11.3 before 0.12.3 and mdex_native from 0.1.0 before 0.2.3.

How To Fix

Latest published version: 0.14.2 as of 23 Oct 2026

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

0.12.3

This is the first release that contains the fix.

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, do not enable full info-string forwarding when rendering untrusted Markdown. This can be done by setting the render option to not include full info-string forwarding. Alternatively, restrict the values of highlight_lines_class to a safe character set, such as [A-Za-z0-9_-].

Conclusion

CVE-2026-53427 is a critical cross-site scripting vulnerability in the MDEx library that can lead to severe security issues. It is essential to update to the patched versions or implement the recommended workarounds to mitigate the risk. Utilizing tools like Vulert can further enhance your application's security posture.

See every vulnerability recorded for mdex →

Share this vulnerability

FAQ

CVE-2026-53427 is a vulnerability in the MDEx library that allows for cross-site scripting (XSS) attacks through unescaped input in the highlight_lines_class attribute.

You can check if your application is affected by using the Vulert playground at Vulert Scanner, which monitors and alerts for open-source vulnerabilities in real-time.

The vulnerability can lead to session theft, account takeover, and other client-side attacks, affecting any user who views the compromised content.

Yes, the vulnerability has been patched in MDEx version 0.12.3 and mdex_native version 0.2.3. It is recommended to update to these versions.

Vulert is a monitoring tool that uses mix.lock to track open-source vulnerabilities in your software. It provides real-time alerts and can help you identify if your application is affected by vulnerabilities like CVE-2026-53427.

Related vulnerabilities

Recent vulnerabilities recorded for mdex.

How To Fix

Latest published version: 0.14.2 as of 23 Oct 2026

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

0.12.3

This is the first release that contains the fix.

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback