{"id":"CVE-2021-26540","aliases":["CLSA-2026-1776644763","EUVD-2021-1141","GHSA-mjxr-4v3x-q3m4","ROOT-APP-NPM-CVE-2021-26540"],"status":"published","title":"Improper Input Validation in sanitize-html","description":"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\".","severity":{"version":"3.1","score":5.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N","level":"medium","assessor":"primary","from":"nvd"},"epss":{"day":"2026-11-09","score":0.01775,"percentile":0.78356,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-20"],"published":"2021-02-08T16:16:07Z","modified":"2026-10-24T10:47:50Z","fixes":[{"ecosystem":"npm","package":"sanitize-html","fixed_in":["2.3.2"],"sources":["ghsa","osv"]},{"ecosystem":"Root:npm","package":"@rootio/sanitize-html","fixed_in":["1.4.2-root.io.3","1.4.2-root.io.4","1.4.2-root.io.5","1.4.2-root.io.6","1.4.2-root.io.7","1.4.2-root.io.8","1.4.2-root.io.9"],"sources":["osv"]},{"ecosystem":"Root:npm","package":"sanitize-html","fixed_in":["1.4.2-aikido.9"],"sources":["osv"]}],"affected":[{"source":"ghsa","ecosystem":"npm","package":"sanitize-html","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.3.2"}]}]},{"source":"osv","ecosystem":"TuxCare:npm","package":"sanitize-html","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"1.27.5-tuxcare.0"},{"fixed":"1.27.5-tuxcare.2"}]}],"versions":["1.27.5","1.27.5-tuxcare.1"],"bundled":3},{"source":"osv","ecosystem":"npm","package":"sanitize-html","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"2.3.2"}]}]},{"source":"osv","ecosystem":"Root:npm","package":"@rootio/sanitize-html","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.4.2-root.io.3"},{"fixed":"1.4.2-root.io.4"},{"fixed":"1.4.2-root.io.5"},{"fixed":"1.4.2-root.io.6"},{"fixed":"1.4.2-root.io.7"},{"fixed":"1.4.2-root.io.8"},{"fixed":"1.4.2-root.io.9"}]}]},{"source":"osv","ecosystem":"Root:npm","package":"sanitize-html","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.4.2-aikido.9"}]}]}],"products":[{"vendor":"apostrophecms","product":"sanitize-html"}],"references":[{"url":"https://github.com/apostrophecms/sanitize-html/blob/main/CHANGELOG.md#232-2021-01-26","tags":["x_refsource_MISC","x_transferred","Release Notes","Third Party Advisory","advisory","web"]},{"url":"https://github.com/apostrophecms/sanitize-html/pull/460","tags":["x_refsource_MISC","x_transferred","Patch","Third Party Advisory","fix","web"]},{"url":"https://advisory.checkmarx.net/advisory/CX-2021-4309","tags":["x_refsource_MISC","x_transferred","Exploit","Patch","Third Party Advisory","fix","web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-26540","tags":["advisory"]},{"url":"https://github.com/advisories/GHSA-mjxr-4v3x-q3m4"}],"sources":{"cve":[{"id":"CVE-2021-26540","description":"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\".","status":"published","published":"2021-02-08T16:16:07Z","modified":"2024-08-03T20:26:25.388Z","updated_at":"2026-11-02T14:32:57.368269Z"}],"euvd":[{"id":"EUVD-2021-1141","description":"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\".","status":"published","published":"2021-02-08T16:16:07Z","modified":"2024-08-03T20:26:25Z","updated_at":"2026-11-03T03:24:51.962182Z"}],"ghsa":[{"id":"GHSA-mjxr-4v3x-q3m4","title":"Improper Input Validation in sanitize-html","description":"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\".","status":"published","published":"2021-05-06T16:10:19Z","modified":"2023-02-01T05:05:21Z","cvss":[{"version":"3.1","score":5.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N","level":"medium"}],"cwes":["CWE-20"],"updated_at":"2026-11-02T14:36:33.613868Z"}],"nvd":[{"id":"CVE-2021-26540","description":"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\".","status":"published","published":"2021-02-08T17:15:13.737Z","modified":"2026-06-17T03:43:27.4Z","cvss":[{"version":"3.1","score":5.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N","level":"medium","assessor":"primary"},{"version":"2.0","score":5,"vector":"AV:N/AC:L/Au:N/C:N/I:P/A:N","level":"medium","assessor":"primary"}],"updated_at":"2026-11-02T14:06:49.660551Z"}],"osv":[{"id":"CVE-2021-26540","description":"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\".","status":"published","published":"2021-02-08T17:15:13.737Z","modified":"2026-10-24T10:47:50.132752435Z","cvss":[{"version":"3.1","score":5.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N","level":"medium"}],"updated_at":"2026-11-02T15:44:18.778776Z"},{"id":"GHSA-mjxr-4v3x-q3m4","title":"Improper Input Validation in sanitize-html","description":"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\".","status":"published","published":"2021-05-06T16:10:19Z","modified":"2023-11-08T04:05:21.154746Z","cvss":[{"version":"3.1","score":5.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N","level":"medium"}],"cwes":["CWE-20"],"updated_at":"2026-11-02T15:46:51.811331Z"},{"id":"CLSA-2026-1776644763","title":"TuxCare security update for sanitize-html (3 CVEs)","description":"TuxCare rebuilt sanitize-html to address 3 CVEs. Fixed in 1.27.5-tuxcare.2.","status":"published","published":"2026-08-04T14:52:18Z","modified":"2026-10-15T09:47:07.395053353Z","updated_at":"2026-11-02T15:43:44.009773Z"},{"id":"ROOT-APP-NPM-CVE-2021-26540","title":"CVE-2021-26540 in @rootio/sanitize-html - Patched by Root","description":"Root has patched CVE-2021-26540 in the @rootio/sanitize-html package for Root:npm. Multiple fixed versions available.","status":"published","published":"2026-06-04T20:57:52Z","modified":"2026-06-05T01:30:49.509135923Z","updated_at":"2026-11-02T15:53:27.362922Z"}]}}
