Skip to content

Improper Input Validation in sanitize-html

Moderate severity GitHub Reviewed Published May 6, 2021 to the GitHub Advisory Database • Updated Feb 1, 2023

Package

npm sanitize-html (npm)

Affected versions

< 2.3.2

Patched versions

2.3.2

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".

References

Published by the National Vulnerability Database Feb 8, 2021
Reviewed Mar 29, 2021
Published to the GitHub Advisory Database May 6, 2021
Last updated Feb 1, 2023

Severity

Moderate
5.3
/ 10

CVSS base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
Low
Availability
None
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N

Weaknesses

CVE ID

CVE-2021-26540

GHSA ID

GHSA-mjxr-4v3x-q3m4

Source code

No known source code
Checking history
See something to contribute? Suggest improvements for this vulnerability.