CVE-2026-48591: CWE-83 Improper Neutralization of Script in Attributes in a Web Page in pragdave earmark
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](http://example.com/?a=x" onerror="alert(1)) 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.
AI Analysis
Technical Summary
This vulnerability in pragdave earmark occurs because attribute values in generated HTML are inserted verbatim between double quotes without proper escaping. While text nodes are escaped, attribute values are not, allowing a crafted markdown link containing a double quote to prematurely close the attribute and inject additional HTML attributes with malicious JavaScript. For example, a markdown link with a URL containing a double quote and an onerror event handler results in arbitrary script execution in the victim's browser. The earmark library has been retired on Hex and will not receive a patch. Versions from 1.4.1 onward are affected.
Potential Impact
An attacker can exploit this vulnerability to execute arbitrary JavaScript in the context of the victim's browser via stored XSS. This can lead to session hijacking, defacement, or other malicious actions depending on the victim's environment and privileges. The CVSS 4.8 (medium severity) reflects the local attack vector and user interaction required, with low confidentiality and integrity impact but limited availability impact.
Mitigation Recommendations
No official patch or fix is available since the earmark library is no longer maintained. Users should migrate away from earmark (versions 1.4.1 and later) to a maintained Markdown library such as MDEx to avoid this vulnerability.
CVE-2026-48591: CWE-83 Improper Neutralization of Script in Attributes in a Web Page in pragdave earmark
Description
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](http://example.com/?a=x" onerror="alert(1)) 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.
CVSS v4.0
Score 4.8medium
Affected software
cpe:2.3:a:pragdave:earmark:*:*:*:*:*:*:*:*Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
This vulnerability in pragdave earmark occurs because attribute values in generated HTML are inserted verbatim between double quotes without proper escaping. While text nodes are escaped, attribute values are not, allowing a crafted markdown link containing a double quote to prematurely close the attribute and inject additional HTML attributes with malicious JavaScript. For example, a markdown link with a URL containing a double quote and an onerror event handler results in arbitrary script execution in the victim's browser. The earmark library has been retired on Hex and will not receive a patch. Versions from 1.4.1 onward are affected.
Potential Impact
An attacker can exploit this vulnerability to execute arbitrary JavaScript in the context of the victim's browser via stored XSS. This can lead to session hijacking, defacement, or other malicious actions depending on the victim's environment and privileges. The CVSS 4.8 (medium severity) reflects the local attack vector and user interaction required, with low confidentiality and integrity impact but limited availability impact.
Mitigation Recommendations
No official patch or fix is available since the earmark library is no longer maintained. Users should migrate away from earmark (versions 1.4.1 and later) to a maintained Markdown library such as MDEx to avoid this vulnerability.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- EEF
- Date Reserved
- 2026-05-22T09:36:56.834Z
- Cvss Version
- 4.0
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a32dadcf198dc38c1cefc7a
Added to database: 06/17/2026, 17:35:24 UTC
Last enriched: 06/24/2026, 19:52:41 UTC
Last updated: 08/01/2026, 19:18:00 UTC
Views: 90
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.