earmark
CVE-2026-48591
MEDIUM
Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessAttacker submits crafted markdown link with embedded double-quote in URL
-
Deliveryearmark splices URL value verbatim into href attribute without encoding
-
ExploitDouble-quote terminates href attribute early
-
ExecutionBrowser parses injected event handler bytes as valid HTML attribute
-
PersistVictim loads page containing stored payload
-
ImpactArbitrary JavaScript executes in victim's authenticated browser session
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Attribute value escaping
|
| Exploitation Conditions | The application must use earmark version 1.4.1 or later to convert markdown to HTML and serve that HTML to other users without an intervening HTML sanitization step. The attacker must be able to submit markdown content that is persisted and subsequently rendered for other users - the stored (persistent) XSS pattern. Earmark itself imposes no authentication requirement on who supplies its input; whether the submission endpoint requires an account depends entirely on the consuming application. The victim must load the page containing the rendered HTML in a browser (passive interaction - no deliberate click on a suspicious link is required; simply viewing the page is sufficient if an auto-firing handler like |
| Impact | A notable inconsistency exists in the provided CVSS 4.0 vector: AV:L (Local) conflicts with the vulnerability description, which clearly depicts a network-delivered stored XSS - a remotely submitted markdown payload stored server-side and later rendered in a victim's browser. AV:N is the accurate characterization and has been used in the independent assessed vector below. The provided score of 4.8 reflects the limited direct CVSS impact (JavaScript execution in victim's browser, not server compromise), but real-world priority is elevated significantly by the permanent absence of a patch path, given the library's retirement. No EPSS score and no CISA KEV listing were present in the provided intelligence, meaning active exploitation in the wild is neither confirmed nor refuted. However, the CVE description includes a working payload ( |
| Exploit ScenarioDerived | An attacker with access to a markdown-accepting input field (such as a comment box, wiki editor, or issue tracker) submits the payload |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Jun 17, 2026
Stored cross-site scripting in earmark (the Elixir Markdown-to-HTML library by pragdave) allows any attacker who can submit markdown content to inject arbitrary JavaScript that executes in the browsers of users who view the rendered output. The root cause is a code path in _make_att1/2 (lib/earmark/transform.ex) that splices HTML attribute values verbatim without encoding double-quote characters, enabling a crafted link URL or title to break out of the href attribute and inject additional HTML event handlers. Critically, no patched version will be released - the library has been officially retired from Hex - making migration to a maintained alternative the only complete fix. No public exploit identified at time of analysis, though the CVE description itself contains a working proof-of-concept payload.
RemediationAI
No vendor-released patch will be issued; earmark is officially retired and the maintainer has confirmed no fix will be released. The primary and complete remediation is to migrate to a maintained Elixir Markdown library - the CVE advisory specifically recommends MDEx, which provides Elixir bindings for the actively maintained comrak (CommonMark) renderer with proper attribute escaping. As a compensating control for applications that cannot immediately migrate, post-process all earmark HTML output through a dedicated HTML sanitization library such as html_sanitize_ex configured to strip event handler attributes (onerror, onmouseover, onclick, etc.) before serving output to users; be aware this adds processing overhead and may affect rendering of intentional inline HTML. A second interim control is to pre-validate or strip bare double-quote characters from link URLs and titles in markdown input before passing to earmark, though this approach is fragile, does not cover all attribute contexts, and should not be treated as a permanent fix. See https://cna.erlef.org/cves/CVE-2026-48591.html for the authoritative advisory confirming the retirement status and migration guidance.
Affects your stack
Find out whether the stacks and servers you run are on an affected version.
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
CWE-83 (Improper Neutralization of Script in Attributes in a Web Page) describes the root cause precisely: HTML attribute values must be encoded before insertion into quoted attribute contexts, and earmark's _make_att1/2 function in lib/earmark/transform.ex fails to do this. The function constructs attribute strings by concatenating [" ", name, "=\"", value, "\""] - wrapping the value in literal double-quote bytes without escaping any double-quotes within value itself. Earmark does have an escape function that converts " to " for text nodes, but attribute values never pass through it. The resulting HTML allows a bare double-quote inside a link URL or title to terminate the href attribute early; the browser then parses remaining bytes as sibling attributes, enabling injection of event handlers such as onerror, onmouseover, or onclick. CPE cpe:2.3:a:pragdave:earmark:*:*:*:*:*:*:*:* with no version bound confirms every release from 1.4.1 onward is vulnerable, with no fixed upper bound since the library is abandoned.
Know when Earmark gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N
Network delivery of stored XSS; PR:L reflects that most applications require an account to submit stored content; victim page-load triggers execution with scope change into browser context.
Primary rating from Vendor (EEF).
CVSS VectorVendor: EEF
DescriptionCVE.org
Improper Neutralization of Script in Attributes in a Web Page vulnerability in pragdave earmark allows stored cross-site scripting via unescaped HTML attribute values.
'Elixir.Earmark.Transform':_make_att1/2 in lib/earmark/transform.ex splices attribute values verbatim between two literal " bytes: [" ", name, "=\"", value, "\""]. Text nodes are routed through the existing escape function which encodes " as ", but attribute values never visit that path. A markdown link whose URL or title contains a bare " closes the attribute early and lets the trailing bytes be parsed by the browser as fresh HTML attributes. For example, click) renders as <a href="http://example.com/?a=x" onerror="alert(1)">click</a>, executing arbitrary JavaScript in the victim's browser.
The earmark library is no longer maintained and has been retired on Hex. No patched version will be released. All releases from 1.4.1 onward are affected, and users should migrate to a maintained Markdown library such as MDEx.
This issue affects earmark from 1.4.1 onward.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.
NVD
CVE.org
EPSS
Vulnrichment
GitHub
VulDB
Exploit-DB