{"id":"CVE-2021-26540","published":"2021-02-08T16:16:07Z","modified":"2024-08-03T20:26:25Z","title":"Apostrophe Technologies sanitize-html before 2.3.2 does not properly validate the hostnames set by the…","vendor":null,"product":null,"tier":"tail","description":{"text":"Apostrophe Technologies sanitize-html before 2.3.2 does not properly validate the hostnames set by the \"allowedIframeHostnames\" option when the \"allowIframeRelativeUrls\" is set to true, which allows attackers to bypass hostname whitelist for iframe element, related using an src value that starts with \"/\\\\example.com\".","provenance":"source","from":"CVE.org"},"cvss":null,"epss":{"score":0.01775,"percentile":0.7875,"provenance":"source"},"cwes":[],"references":[{"url":"https://github.com/apostrophecms/sanitize-html/blob/main/CHANGELOG.md#232-2021-01-26","tags":["x_refsource_MISC"]},{"url":"https://github.com/apostrophecms/sanitize-html/pull/460","tags":["x_refsource_MISC"]},{"url":"https://advisory.checkmarx.net/advisory/CX-2021-4309","tags":["x_refsource_MISC"]}],"priority":{"score":15.8,"factors":[{"name":"EPSS percentile","points":15.75}]},"affected":[{"ecosystem":"npm","package":"sanitize-html","vulnerableRanges":["<2.3.2"],"patched":["2.3.2"],"from":["GHSA-mjxr-4v3x-q3m4"],"provenance":"source"}],"summary":{"text":"The flaw is in the sanitize-html library from Apostrophe Technologies, in versions before 2.3.2, where the hostname validation for iframe sources is not performed correctly. An attacker can bypass the \"allowedIframeHostnames\" whitelist when \"allowIframeRelativeUrls\" is enabled, by supplying an iframe src value beginning with \"/\\\\\" followed by a hostname, which lets through iframes pointing at hosts the whitelist was meant to block, provided the application passes attacker-influenced HTML through the sanitizer with those options set.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:40:09Z"},"euvd":{"id":"EUVD-2021-1141","exploited":false,"provenance":"source"},"lineage":{"packageHistory":[{"cve":"CVE-2017-16016","published":"2018-06-04","fixed":"1.11.4","kev":false},{"cve":"CVE-2019-25225","published":"2025-09-08","fixed":"2.0.0-beta","kev":false},{"cve":"CVE-2021-26539","published":"2021-02-08","fixed":"2.3.1","kev":false,"link":{"from":"CVE-2021-26539","to":"CVE-2021-26540","relation":"successor","confidence":"medium","kind":"sequence","orderedBy":"description","evidence":[{"kind":"version-step","provenance":"source","package":"npm:sanitize-html","fromFixed":"2.3.1","toFixed":"2.3.2","daysApart":0},{"kind":"similar","provenance":"machine","score":0.57,"basis":"same package + description similarity"}]}},{"cve":"CVE-2021-26540","published":"2021-02-08","fixed":"2.3.2","kev":false},{"cve":"CVE-2022-25887","published":"2022-08-30","fixed":"2.7.1","kev":false,"link":{"from":"CVE-2021-26540","to":"CVE-2022-25887","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"npm:sanitize-html","fromFixed":"2.3.2","toFixed":"2.7.1","daysApart":568}]}},{"cve":"CVE-2024-21501","published":"2024-02-24","fixed":"2.12.1","kev":false},{"cve":"CVE-2026-40186","published":"2026-04-15","fixed":"2.17.3","kev":false}],"package":"npm:sanitize-html"}}