ModerateVulnerabilityGHSA-vfvf-mqq8-rwqcCVE-2016-10531Published 18 Feb 2019
Sanitization bypass using HTML Entities in marked
Affected · marked
- < 0.3.6
Fixed in
0.3.6
npm install marked@0.3.6Affected
0.0.1 – 0.3.5
36 releases
Fixed
0.3.6 – 18.1.1
189 releases, latest
What happens
Affected versions of marked are susceptible to a cross-site scripting vulnerability in link components when sanitize:true is configured.
Proof of Concept
This flaw exists because link URIs containing HTML entities get processed in an abnormal manner. Any HTML Entities get parsed on a best-effort basis and included in the resulting link, while if that parsing fails that character is omitted.
For example:
A link URI such as
javascript֍ocument;alert(1)
Renders a valid link that when clicked will execute alert(1).
Recommendation
Update to version 0.3.6 or later.