MediumGHSA-mjxr-4v3x-q3m4CVE-2021-26540
Improper Input Validation in sanitize-html
Published 6 May 2021 · Updated 8 Nov 2023
Affected package
- Affected
- <2.3.2
- Fixed in
- 2.3.2
Update to the fixed version for your release line, for example:
npm install sanitize-html@2.3.2Details
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".
Is GHSA-mjxr-4v3x-q3m4 in any of your client repos?
Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected sanitize-html, and gives you the command that fixes it.
References
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.