# CVE-2026-48591: Stored XSS via unescaped HTML attribute values in earmark

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 4.8
- **CVSS:** 4.8 (v4.0, CNA) `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`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Attack requirements: None; Privileges required: None; User interaction: Passive; Confidentiality impact: Low; Integrity impact: Low; Availability impact: None; Confidentiality impact on other systems: Low; Integrity impact on other systems: Low; Availability impact on other systems: None
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.20% (percentile 5, 2026-11-26)
- **CWE:** CWE-83
- **Published:** 2026-06-17T16:42:37.508Z
- **Modified:** 2026-11-25T04:37:59.837Z

## Who should check

- Anyone running pragdave earmark \>= 1.4.1, \< \*
- Anyone running pragdave earmark \>= 8236a0570bd894b50e360da08131ec3294c20799, \< \*

## 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.

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\](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.

## Affected and fixed versions

- pragdave earmark: \>= 1.4.1, \< \* (cvelist)
- pragdave earmark: \>= 8236a0570bd894b50e360da08131ec3294c20799, \< \* (cvelist)

## Mitigation

- Vendor workaround: Migrate to a maintained Markdown library such as MDEx (https://hex.pm/packages/mdex). The earmark package has been retired on Hex and no patched release will be made.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2026-48591. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2026-48591.md
Affected: pragdave earmark >= 1.4.1, < *; pragdave earmark >= 8236a0570bd894b50e360da08131ec3294c20799, < *
Fixed in: no fixed version listed yet

Steps:
1. Search this machine and project for pragdave earmark: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2026-48591 being exploited?

There is no confirmed exploitation: CVE-2026-48591 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.20% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2026-48591?

Medium: CVSS 4.8 (v4.0, scored by CNA). Not remotely exploitable (local or adjacent access needed). A user has to take an action, such as opening a link, for the attack to work.

### Which versions are affected by CVE-2026-48591?

pragdave earmark \>= 1.4.1, \< \*; pragdave earmark \>= 8236a0570bd894b50e360da08131ec3294c20799, \< \*.

### Is there a fix for CVE-2026-48591?

No fixed version is listed in the sources yet. Vendor workaround: Migrate to a maintained Markdown library such as MDEx (https://hex.pm/packages/mdex). The earmark package has been retired on Hex and no patched release will be made.

### How do I check if I'm affected by CVE-2026-48591?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://github.com/pragdave/earmark/commit/8236a0570bd894b50e360da08131ec3294c20799>
- other: <https://cna.erlef.org/cves/CVE-2026-48591.html>
- other: <https://osv.dev/vulnerability/EEF-CVE-2026-48591>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2026-48591>

HTML: <https://flawdb.com/CVE-2026-48591> · JSON: <https://flawdb.com/api/v1/entries/CVE-2026-48591>
