medium5.3
CVE-2021-26540
Improper Input Validation in sanitize-html
Impact
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 packages
| Ecosystem | Package | Affected | Fixed in |
|---|---|---|---|
| npm | sanitize-html | < 2.3.2 | 2.3.2 |
Affected products
| Vendor | Product | Affected versions |
|---|---|---|
| Apostrophecms | Sanitize-Html | before 2.3.2 |
Weakness classification
References
- NVD record
- CVE.org record
- GitHub advisory
- https://advisory.checkmarx.net/advisory/CX-2021-4309
- https://github.com/apostrophecms/sanitize-html/blob/main/CHANGELOG.md#232-2021-01-26
- https://github.com/apostrophecms/sanitize-html/pull/460
- https://github.com/advisories/GHSA-mjxr-4v3x-q3m4
- https://nvd.nist.gov/vuln/detail/CVE-2021-26540