Skip to main content

earmark CVE-2026-48591

MEDIUM
Improper Neutralization of Script in Attributes in a Web Page (CWE-83)
2026-06-17 EEF
4.8
CVSS 4.0 · Vendor: EEF
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Attacker submits crafted markdown link with embedded double-quote in URL
  2. Delivery
    earmark splices URL value verbatim into href attribute without encoding
  3. Exploit
    Double-quote terminates href attribute early
  4. Execution
    Browser parses injected event handler bytes as valid HTML attribute
  5. Persist
    Victim loads page containing stored payload
  6. Impact
    Arbitrary 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 onload or onerror is used). Exploitation is blocked if: the application re-escapes earmark's HTML output before insertion into templates (double-encoding), a sanitization library strips event handler attributes from rendered output, the application does not accept user-supplied markdown at all, or earmark output is used only in non-browser contexts (e.g., PDF generation, plain-text email).

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 (click)), which constitutes de facto public proof-of-concept; the mechanics require no encoding bypass, heap grooming, or race condition - just a single unescaped character. Any application accepting untrusted user markdown and rendering earmark output directly to other users is fully exposed with no mitigating library-level fix available.

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 click) and the content is stored server-side. When any user's browser loads the page containing the earmark-rendered HTML, the injected onerror attribute fires, executing JavaScript that exfiltrates the victim's session cookie to an attacker-controlled endpoint. The CVE description provides a working proof-of-concept demonstrating this exact injection path.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
No patch listed yet 0.1% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – 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

Vendor (EEF) PRIMARY 4.8 MEDIUM
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
vuln.today AI 5.4 MEDIUM

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.

3.1 AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N
4.0 AV:N/AC:L/AT:N/PR:L/UI:P/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N

Primary rating from Vendor (EEF).

CVSS VectorVendor: EEF

Attack Vector
Local
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
Passive
Vulnerable system: Confidentiality
Low
Vulnerable system: Integrity
Low
Vulnerable system: Availability
None
Subsequent system: Confidentiality
Low
Subsequent system: Integrity
Low
Subsequent system: Availability
None

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 &quot;, 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

EPSS Score
0.1%
Top 97% exploitable
Data Quality
5 sources
Confidence: Medium
NVD CVE.org EPSS Vulnrichment GitHub VulDB

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.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.1%
Patch available No
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Defer
Exploitation
None
System Exposure· derived
Small
Automatable
No
Human Impact· derived
Medium
Technical Impact
Partial

Priority Score

24
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +24
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Cross-Site Scripting occurs when an application accepts untrusted data and sends it to a web browser without proper validation or encoding.

Affected Products (CPE)CVE.org

cpe:2.3:a:pragdave:earmark:*:*:*:*:*:*:*:*
cpe:2.3:a:pragdave:earmark:*:*:*:*:*:*:*:*

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy