GHSA-52mm-h59v-f3c7

Suggest an improvement
Source
https://github.com/advisories/GHSA-52mm-h59v-f3c7
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/06/GHSA-52mm-h59v-f3c7/GHSA-52mm-h59v-f3c7.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-52mm-h59v-f3c7
Aliases
Published
2026-06-17T18:35:58Z
Modified
2026-06-18T15:11:22Z
Severity
  • 4.8 (Medium) CVSS_V4 - 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 Calculator
Summary
earmark: Stored XSS via unescaped HTML attribute values
Details

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 click, 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.

Database specific
{
    "cwe_ids":  [
        "CWE-79",
        "CWE-83"
    ],
    "github_reviewed":  true,
    "github_reviewed_at":  "2026-06-18T14:47:16Z",
    "nvd_published_at":  "2026-06-17T18:18:04Z",
    "severity":  "MODERATE"
}
References

Affected packages

Hex / earmark

Package

Name
earmark
Purl
pkg:hex/earmark

Affected ranges

Type
SEMVER
Events
Introduced
1.4.1
Last Affected
1.5.0-pre1

Affected versions

1.*
1.4.1
1.4.2
1.4.3
1.4.4
1.4.5
1.4.6
1.4.7
1.4.8
1.4.9
1.4.10
1.4.12
1.4.13
1.4.14
1.4.15
1.4.16-pre
1.4.16-pre1
1.4.16-pre2
1.4.16
1.4.17
1.4.18
1.4.19
1.4.20
1.4.21
1.4.22
1.4.23
1.4.24
1.4.25
1.4.26
1.4.27
1.4.28
1.4.29
1.4.30
1.4.31
1.4.32
1.4.33
1.4.34
1.4.35
1.4.36
1.4.37
1.4.38
1.4.39
1.4.40
1.4.41
1.4.42
1.4.43
1.4.44
1.4.45
1.4.46
1.4.47
1.4.48
1.4.49
1.5.0-pre
1.5.0-pre1

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/06/GHSA-52mm-h59v-f3c7/GHSA-52mm-h59v-f3c7.json"