CVE-2021-26540
MEDIUM 5.3CVSS 3.1Improper Input Validation in sanitize-html
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".
- Published
- 8 Feb 2021
- Last modified
- 17 Jun 2026
- Assigned by
- cve@mitre.org
- NVD status
- Modified
- Weakness
- CWE-20
- Also known as
- GHSA-mjxr-4v3x-q3m4
- Sources
- NVDJSONOSV GHSA-mjxr-4v3x-q3m4JSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | nvd@nist.gov (Primary) | CVSS 3.1 | MEDIUM 5.3 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N |
| OSV | GitHub | CVSS 3.1 | MEDIUM 5.3 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N |
| NVD | nvd@nist.gov (Primary) | CVSS 2.0 | MEDIUM 5.0 | AV:N/AC:L/Au:N/C:N/I:P/A:N |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | apostrophecms | sanitize-htmlcpe:2.3:a:apostrophecms:sanitize-html:*:*:*:*:*:node.js:*:* |
< 2.3.2 | 2.3.2 |
| OSV | npm | sanitize-html | < 2.3.2 | 2.3.2 |
References
- https://advisory.checkmarx.net/advisory/CX-2021-4309 · Exploit, Patch, Third Party Advisory, WEB
- https://github.com/apostrophecms/sanitize-html/blob/main/CHANGELOG.md#232-2021-01-26 · Release Notes, Third Party Advisory, WEB
- https://github.com/apostrophecms/sanitize-html/pull/460 · Patch, Third Party Advisory, WEB
- https://nvd.nist.gov/vuln/detail/CVE-2021-26540 · ADVISORY
History
- 25 Nov 2026 20:32 UTC · NVD: first stored (published 8 Feb 2021)
- 25 Nov 2026 20:11 UTC · OSV: first stored (published 6 May 2021)