CVE-2026-48591: Earmark Stored XSS via Unescaped HTML Attribute Values

earmark Updated 18 Jun 2026

Summary

17/06/2026
No i
Moderate
4.8

CVE-2026-48591: earmark: Stored XSS via unescaped HTML attribute values. Affects earmark versions >= 1.4.1, <= 1.5.0-pre1. No fix is published. 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

Earmark is a Markdown library for Elixir that converts Markdown text into HTML. It is designed to be simple and efficient, allowing developers to easily integrate Markdown processing into their applications. However, the library has been retired and is no longer maintained, making it vulnerable to various security issues, including the one described here.

Vulnerability Detail

The vulnerability arises from improper neutralization of script in attributes within a web page, specifically in the Earmark library. The function '_make_att1/2' in 'lib/earmark/transform.ex' improperly handles attribute values, splicing them verbatim between literal double quotes. This allows for stored cross-site scripting (XSS) when a Markdown link's URL or title contains unescaped double quotes. For instance, a link formatted as [click](http://example.com/?a=x" onerror="alert(1)) will render as <a href="http://example.com/?a=x" onerror="alert(1)">click</a>, executing arbitrary JavaScript in the victim's browser. This vulnerability affects all versions from 1.4.1 onward.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

As there is no patch available, the best workaround is to avoid using Earmark for rendering untrusted Markdown content. If you must use it, ensure that any user-generated content is sanitized to prevent XSS attacks.

Conclusion

The Earmark library has a serious vulnerability that allows for stored XSS via unescaped HTML attribute values. With no patches available, users must migrate to a different library to ensure the security of their applications. It is crucial to remain vigilant and utilize tools like Vulert for monitoring vulnerabilities.

See every vulnerability recorded for earmark →

Share this vulnerability

FAQ

The CVSS score of this vulnerability is 4.8, indicating a moderate severity level.

All versions from 1.4.1 onward are affected by this vulnerability.

No, Earmark has been retired and no patched version will be released.

You should migrate to a maintained Markdown library such as MDEx to avoid this vulnerability.

You can use Vulert to monitor and alert in real-time for open-source vulnerabilities in your software. You can check your application using the Vulert playground at Vulert Scanner without any signup.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. 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