{"id":"CVE-2021-26540","aliases":["CVE-2021-26540","GHSA-mjxr-4v3x-q3m4"],"related":[],"kind":"vulnerability","state":"published","title":"Improper Input Validation in sanitize-html","summary":"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\".","summarySource":"cvelist","descriptions":[{"lang":"en","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\".","source":"cvelist"},{"lang":"es","text":"Apostrophe Technologies sanitize-html versiones anteriores a 2.3.2 no comprueba correctamente los nombres de host establecidos por la opción \"allowedIframeHostnames\" cuando \"allowIframeRelativeUrls\" se establece en true, lo que permite a atacantes omitir la lista blanca de nombres de host para el elemento iframe, relacionado con un valor src que comienza con \"/\\\\example.com\"","source":"nvd"}],"published":"2021-02-08T16:16:07.000Z","modified":"2026-06-17T03:43:27.400Z","severity":{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N","score":5.3,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N","score":5.3,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N","score":5.3,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:N/AC:L/Au:N/C:N/I:P/A:N","score":5,"rating":"MEDIUM"}],"cwes":["CWE-20"],"affected":[{"ranges":[{"version":"n/a","status":"affected"}],"source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"2.3.2"}],"ecosystem":"npm","package":"sanitize-html","purl":"pkg:npm/sanitize-html","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"2.3.2"}],"vendor":"apostrophecms","product":"sanitize-html","cpe":"cpe:2.3:a:apostrophecms:sanitize-html:*:*:*:*:*:node.js:*:*","source":"nvd"}],"references":[{"url":"https://github.com/apostrophecms/sanitize-html/blob/main/CHANGELOG.md#232-2021-01-26","tags":["release-notes","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/apostrophecms/sanitize-html/pull/460","tags":["patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://advisory.checkmarx.net/advisory/CX-2021-4309","tags":["exploit","patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-26540","tags":["advisory"],"sources":["ghsa"]}],"credits":[],"assigner":"mitre","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2021-26540","url":"https://www.cve.org/CVERecord?id=CVE-2021-26540","licence":"CVE Terms of Use","modified":"2024-08-03T20:26:25.388Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-mjxr-4v3x-q3m4","url":"https://github.com/advisories/GHSA-mjxr-4v3x-q3m4","licence":"CC-BY-4.0","modified":"2023-11-08T04:05:21.154Z"},{"source":"nvd","name":"NVD","id":"CVE-2021-26540","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-26540","licence":"Public domain","modified":"2026-06-17T03:43:27.400Z"}],"updatedAt":"2026-11-25T22:57:59.839Z","epss":{"score":0.01775,"percentile":0.78852,"date":"2026-12-01T12:00:22.000Z"}}