{"id":"CVE-2021-26540","aliases":["GHSA-mjxr-4v3x-q3m4"],"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 allow...","published_at":"2021-01-26T00:00:00Z","modified_at":"2026-02-27T04:21:43Z","products":[{"slug":"rhel","name":"Red Hat Enterprise Linux","category":"red-hat"}],"rating":{"severity":"medium","score":5.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N","attack_path":"internet_unauthenticated","user_interaction":false,"malicious":false,"red_hat":"Moderate","vendor_ratings":[{"source":"Red Hat","rating":"Moderate"}]},"fix_available":false,"kev":{"listed":false,"ransomware":false},"public_exploit":false,"exploits":[],"epss":{"score":0.017750000581145287,"percentile":0.7868099808692932,"date":"2026-11-19T00:00:00Z"},"priority":7.3,"details":"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\".","affected_stack":[{"ecosystem":"Red Hat:service_mesh:2.0","package":"servicemesh-prometheus","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"provider":"redhat-vex","source":"CVE-2021-26540","relation":"self"}],"affected_other":[{"ecosystem":"NVD","package":"apostrophecms:sanitize-html","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.3.2"}]}],"fixed":["2.3.2"],"provider":"nvd","source":"CVE-2021-26540","relation":"self"},{"ecosystem":"TuxCare:npm","package":"sanitize-html","purl":"pkg:npm/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"],"fixed":["1.27.5-tuxcare.2"],"provider":"osv","source":"CLSA-2026-1776644763","relation":"upstream"},{"ecosystem":"npm","package":"sanitize-html","purl":"pkg:npm/sanitize-html","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"2.3.2"}]}],"fixed":["2.3.2"],"provider":"osv","source":"GHSA-mjxr-4v3x-q3m4","relation":"self"}],"product_status":[{"vendor":"Red Hat","product":"OpenShift Service Mesh 2.0","cpe":"cpe:/a:redhat:service_mesh:2.0","status":"affected","packages":["servicemesh-prometheus"],"package_count":1,"fixed":[],"advisories":[],"note":"Affected","provider":"redhat-vex","source":"CVE-2021-26540"},{"vendor":"Red Hat","product":"Red Hat OpenShift Container Platform 4.8","cpe":"cpe:/a:redhat:openshift:4.8::el8","status":"fixed","packages":["openshift4/ose-console","openshift4/ose-thanos-rhel8"],"package_count":2,"fixed":[],"advisories":["RHSA-2021:2438"],"provider":"redhat-vex","source":"CVE-2021-26540"},{"vendor":"Red Hat","product":"Red Hat OpenShift Container Platform 4.8","cpe":"cpe:/a:redhat:openshift:4.8::el8","status":"not_affected","packages":["openshift4/driver-toolkit-rhel8","openshift4/egress-router-cni-rhel8","openshift4/network-tools-rhel8","openshift4/ose-aws-ebs-csi-driver-rhel8","openshift4/ose-aws-ebs-csi-driver-rhel8-operator","openshift4/ose-aws-machine-controllers","openshift4/ose-aws-pod-identity-webhook-rhel8","openshift4/ose-azure-disk-csi-driver-rhel8","openshift4/ose-azure-disk-csi-driver-rhel8-operator","openshift4/ose-azure-machine-controllers","openshift4/ose-baremetal-installer-rhel8","openshift4/ose-baremetal-machine-controllers","openshift4/ose-baremetal-rhel8-operator","openshift4/ose-baremetal-runtimecfg-rhel8","openshift4/ose-cli","openshift4/ose-cli-artifacts","openshift4/ose-cloud-credential-operator","openshift4/ose-cluster-authentication-operator","openshift4/ose-cluster-autoscaler","openshift4/ose-cluster-autoscaler-operator","openshift4/ose-cluster-baremetal-operator-rhel8","openshift4/ose-cluster-bootstrap","openshift4/ose-cluster-config-operator","openshift4/ose-cluster-csi-snapshot-controller-rhel8-operator","openshift4/ose-cluster-dns-operator"],"package_count":140,"fixed":[],"advisories":[],"note":"vulnerable_code_not_present","provider":"redhat-vex","source":"CVE-2021-26540"},{"vendor":"Red Hat","product":"Red Hat OpenShift Container Platform 4.9","cpe":"cpe:/a:redhat:openshift:4.9::el8","status":"fixed","packages":["openshift4/ose-prometheus"],"package_count":1,"fixed":[],"advisories":["RHSA-2021:3759"],"provider":"redhat-vex","source":"CVE-2021-26540"},{"vendor":"Red Hat","product":"Red Hat OpenShift Container Platform 4.9","cpe":"cpe:/a:redhat:openshift:4.9::el8","status":"not_affected","packages":["openshift4/driver-toolkit-rhel8","openshift4/egress-router-cni-alt-rhel8","openshift4/egress-router-cni-rhel8","openshift4/network-tools-rhel8","openshift4/ose-aws-cloud-controller-manager-rhel8","openshift4/ose-aws-ebs-csi-driver-rhel8","openshift4/ose-aws-ebs-csi-driver-rhel8-operator","openshift4/ose-aws-machine-controllers","openshift4/ose-aws-pod-identity-webhook-rhel8","openshift4/ose-azure-cloud-controller-manager-rhel8","openshift4/ose-azure-cloud-node-manager-rhel8","openshift4/ose-azure-disk-csi-driver-rhel8","openshift4/ose-azure-disk-csi-driver-rhel8-operator","openshift4/ose-azure-machine-controllers","openshift4/ose-baremetal-installer-rhel8","openshift4/ose-baremetal-machine-controllers","openshift4/ose-baremetal-rhel8-operator","openshift4/ose-baremetal-runtimecfg-rhel8","openshift4/ose-cli","openshift4/ose-cli-alt-rhel8","openshift4/ose-cli-artifacts","openshift4/ose-cli-artifacts-alt-rhel8","openshift4/ose-cloud-credential-operator","openshift4/ose-cluster-authentication-operator","openshift4/ose-cluster-autoscaler"],"package_count":147,"fixed":[],"advisories":[],"note":"vulnerable_code_not_present","provider":"redhat-vex","source":"CVE-2021-26540"}],"records":[{"provider":"osv","source_id":"CLSA-2026-1776644763","relation":"upstream","url":"https://osv.dev/vulnerability/CLSA-2026-1776644763","published_at":"2026-08-04T14:52:18Z","modified_at":"2026-10-15T09:47:07.395053Z","summary":"TuxCare security update for sanitize-html (3 CVEs)","details":"TuxCare rebuilt sanitize-html to address 3 CVEs. Fixed in 1.27.5-tuxcare.2.","severity":[],"affected":[{"ecosystem":"TuxCare:npm","package":"sanitize-html","purl":"pkg:npm/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"],"fixed":["1.27.5-tuxcare.2"],"provider":"osv","source":"CLSA-2026-1776644763","relation":"upstream"}],"product_status":[],"references":[]},{"provider":"cvelistv5","source_id":"CVE-2021-26540","relation":"self","url":"https://www.cve.org/CVERecord?id=CVE-2021-26540","license":"CC-BY-4.0","published_at":"2021-02-08T16:16:07Z","modified_at":"2024-08-03T20:26:25.388Z","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 allow...","details":"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":[],"affected":[],"product_status":[],"references":[{"type":"WEB","url":"https://github.com/apostrophecms/sanitize-html/blob/main/CHANGELOG.md#232-2021-01-26"},{"type":"WEB","url":"https://github.com/apostrophecms/sanitize-html/pull/460"},{"type":"WEB","url":"https://advisory.checkmarx.net/advisory/CX-2021-4309"}]},{"provider":"nvd","source_id":"CVE-2021-26540","relation":"self","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-26540","severity":[],"affected":[{"ecosystem":"NVD","package":"apostrophecms:sanitize-html","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.3.2"}]}],"fixed":["2.3.2"],"provider":"nvd","source":"CVE-2021-26540","relation":"self"}],"product_status":[],"references":[]},{"provider":"osv","source_id":"GHSA-mjxr-4v3x-q3m4","relation":"self","url":"https://osv.dev/vulnerability/GHSA-mjxr-4v3x-q3m4","license":"CC-BY-4.0","published_at":"2021-05-06T16:10:19Z","modified_at":"2023-11-08T04:05:21.154746Z","summary":"Improper Input Validation in sanitize-html","details":"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":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N","source":"GHSA-mjxr-4v3x-q3m4"}],"affected":[{"ecosystem":"npm","package":"sanitize-html","purl":"pkg:npm/sanitize-html","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"2.3.2"}]}],"fixed":["2.3.2"],"provider":"osv","source":"GHSA-mjxr-4v3x-q3m4","relation":"self"}],"product_status":[],"references":[{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-26540"},{"type":"WEB","url":"https://github.com/apostrophecms/sanitize-html/pull/460"},{"type":"WEB","url":"https://advisory.checkmarx.net/advisory/CX-2021-4309"},{"type":"WEB","url":"https://github.com/apostrophecms/sanitize-html/blob/main/CHANGELOG.md#232-2021-01-26"}]},{"provider":"redhat-vex","source_id":"CVE-2021-26540","relation":"self","url":"https://access.redhat.com/security/cve/CVE-2021-26540","license":"CC-BY-4.0","published_at":"2021-01-26T00:00:00Z","modified_at":"2026-02-27T04:21:43Z","summary":"sanitize-html: improper validation of hostnames set by the \"allowedIframeHostnames\" option can lead to bypass hostname whitelist for iframe element","details":"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":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N","source":"CVE-2021-26540"},{"type":"Red Hat","score":"Moderate","source":"CVE-2021-26540"}],"affected":[{"ecosystem":"Red Hat:service_mesh:2.0","package":"servicemesh-prometheus","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"provider":"redhat-vex","source":"CVE-2021-26540","relation":"self"}],"product_status":[{"vendor":"Red Hat","product":"OpenShift Service Mesh 2.0","cpe":"cpe:/a:redhat:service_mesh:2.0","status":"affected","packages":["servicemesh-prometheus"],"package_count":1,"fixed":[],"advisories":[],"note":"Affected","provider":"redhat-vex","source":"CVE-2021-26540"},{"vendor":"Red Hat","product":"Red Hat OpenShift Container Platform 4.8","cpe":"cpe:/a:redhat:openshift:4.8::el8","status":"fixed","packages":["openshift4/ose-console","openshift4/ose-thanos-rhel8"],"package_count":2,"fixed":[],"advisories":["RHSA-2021:2438"],"provider":"redhat-vex","source":"CVE-2021-26540"},{"vendor":"Red Hat","product":"Red Hat OpenShift Container Platform 4.8","cpe":"cpe:/a:redhat:openshift:4.8::el8","status":"not_affected","packages":["openshift4/driver-toolkit-rhel8","openshift4/egress-router-cni-rhel8","openshift4/network-tools-rhel8","openshift4/ose-aws-ebs-csi-driver-rhel8","openshift4/ose-aws-ebs-csi-driver-rhel8-operator","openshift4/ose-aws-machine-controllers","openshift4/ose-aws-pod-identity-webhook-rhel8","openshift4/ose-azure-disk-csi-driver-rhel8","openshift4/ose-azure-disk-csi-driver-rhel8-operator","openshift4/ose-azure-machine-controllers","openshift4/ose-baremetal-installer-rhel8","openshift4/ose-baremetal-machine-controllers","openshift4/ose-baremetal-rhel8-operator","openshift4/ose-baremetal-runtimecfg-rhel8","openshift4/ose-cli","openshift4/ose-cli-artifacts","openshift4/ose-cloud-credential-operator","openshift4/ose-cluster-authentication-operator","openshift4/ose-cluster-autoscaler","openshift4/ose-cluster-autoscaler-operator","openshift4/ose-cluster-baremetal-operator-rhel8","openshift4/ose-cluster-bootstrap","openshift4/ose-cluster-config-operator","openshift4/ose-cluster-csi-snapshot-controller-rhel8-operator","openshift4/ose-cluster-dns-operator"],"package_count":140,"fixed":[],"advisories":[],"note":"vulnerable_code_not_present","provider":"redhat-vex","source":"CVE-2021-26540"},{"vendor":"Red Hat","product":"Red Hat OpenShift Container Platform 4.9","cpe":"cpe:/a:redhat:openshift:4.9::el8","status":"fixed","packages":["openshift4/ose-prometheus"],"package_count":1,"fixed":[],"advisories":["RHSA-2021:3759"],"provider":"redhat-vex","source":"CVE-2021-26540"},{"vendor":"Red Hat","product":"Red Hat OpenShift Container Platform 4.9","cpe":"cpe:/a:redhat:openshift:4.9::el8","status":"not_affected","packages":["openshift4/driver-toolkit-rhel8","openshift4/egress-router-cni-alt-rhel8","openshift4/egress-router-cni-rhel8","openshift4/network-tools-rhel8","openshift4/ose-aws-cloud-controller-manager-rhel8","openshift4/ose-aws-ebs-csi-driver-rhel8","openshift4/ose-aws-ebs-csi-driver-rhel8-operator","openshift4/ose-aws-machine-controllers","openshift4/ose-aws-pod-identity-webhook-rhel8","openshift4/ose-azure-cloud-controller-manager-rhel8","openshift4/ose-azure-cloud-node-manager-rhel8","openshift4/ose-azure-disk-csi-driver-rhel8","openshift4/ose-azure-disk-csi-driver-rhel8-operator","openshift4/ose-azure-machine-controllers","openshift4/ose-baremetal-installer-rhel8","openshift4/ose-baremetal-machine-controllers","openshift4/ose-baremetal-rhel8-operator","openshift4/ose-baremetal-runtimecfg-rhel8","openshift4/ose-cli","openshift4/ose-cli-alt-rhel8","openshift4/ose-cli-artifacts","openshift4/ose-cli-artifacts-alt-rhel8","openshift4/ose-cloud-credential-operator","openshift4/ose-cluster-authentication-operator","openshift4/ose-cluster-autoscaler"],"package_count":147,"fixed":[],"advisories":[],"note":"vulnerable_code_not_present","provider":"redhat-vex","source":"CVE-2021-26540"}],"references":[{"type":"WEB","url":"https://security.access.redhat.com/data/csaf/v2/vex/2021/cve-2021-26540.json"},{"type":"WEB","url":"https://access.redhat.com/security/cve/CVE-2021-26540"},{"type":"WEB","url":"https://bugzilla.redhat.com/show_bug.cgi?id=1932323"},{"type":"WEB","url":"https://www.cve.org/CVERecord?id=CVE-2021-26540"},{"type":"WEB","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-26540"}]}],"references":[{"type":"WEB","url":"https://github.com/apostrophecms/sanitize-html/blob/main/CHANGELOG.md#232-2021-01-26"},{"type":"WEB","url":"https://github.com/apostrophecms/sanitize-html/pull/460"},{"type":"WEB","url":"https://advisory.checkmarx.net/advisory/CX-2021-4309"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-26540"},{"type":"WEB","url":"https://security.access.redhat.com/data/csaf/v2/vex/2021/cve-2021-26540.json"},{"type":"WEB","url":"https://access.redhat.com/security/cve/CVE-2021-26540"},{"type":"WEB","url":"https://bugzilla.redhat.com/show_bug.cgi?id=1932323"},{"type":"WEB","url":"https://www.cve.org/CVERecord?id=CVE-2021-26540"}],"sources":[{"provider":"osv","source_id":"CLSA-2026-1776644763","url":"https://osv.dev/vulnerability/CLSA-2026-1776644763","modified_at":"2026-10-15T09:47:07.395053Z","relation":"upstream"},{"provider":"cvelistv5","source_id":"CVE-2021-26540","url":"https://www.cve.org/CVERecord?id=CVE-2021-26540","license":"CC-BY-4.0","modified_at":"2024-08-03T20:26:25.388Z","relation":"self"},{"provider":"nvd","source_id":"CVE-2021-26540","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-26540","relation":"self"},{"provider":"osv","source_id":"GHSA-mjxr-4v3x-q3m4","url":"https://osv.dev/vulnerability/GHSA-mjxr-4v3x-q3m4","license":"CC-BY-4.0","modified_at":"2023-11-08T04:05:21.154746Z","relation":"self"},{"provider":"redhat-vex","source_id":"CVE-2021-26540","url":"https://access.redhat.com/security/cve/CVE-2021-26540","license":"CC-BY-4.0","modified_at":"2026-02-27T04:21:43Z","relation":"self"}]}
