PT-2021-17027 · Unknown · Sanitize-Html

Ron Masas

·

Published

2021-02-08

·

Updated

2026-06-04

·

CVE-2021-26540

CVSS v3.1

5.3

Medium

VectorAV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N
Name of the Vulnerable Software and Affected Versions sanitize-html versions prior to 2.3.2
Description The issue arises from improper validation of hostnames set by the allowedIframeHostnames option when allowIframeRelativeUrls is set to true. This allows attackers to bypass the hostname whitelist for iframe elements by using an src value that starts with "/example.com".
Recommendations For versions prior to 2.3.2, update to version 2.3.2 or later to resolve the issue. As a temporary workaround, consider setting allowIframeRelativeUrls to false to prevent the bypass of the hostname whitelist. Restrict access to iframe elements with src values starting with "/example.com" to minimize the risk of exploitation.

Exploit

Fix

RCE

Found an issue in the description? Have something to add? Feel free to write us 👾

Weakness Enumeration

Related Identifiers

CVE-2021-26540
GHSA-MJXR-4V3X-Q3M4

Affected Products

Sanitize-Html