Advisory Database
  • Advisories
  • Dependency Scanning
  1. npm
  2. ›
  3. sanitize-html
  4. ›
  5. CVE-2021-26540

CVE-2021-26540: Origin Validation Error

February 8, 2021 (updated April 1, 2021)

sanitize-html does not properly validate the hostnames set by the allowedIframeHostnames option when the allowIframeRelativeUrls is set to true, which allows attackers to bypass the hostname allow list for an iframe element.

References

  • nvd.nist.gov/vuln/detail/CVE-2021-26540

Code Behaviors & Features

Detect and mitigate CVE-2021-26540 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 2.3.2

Fixed versions

  • 2.3.2

Solution

Upgrade to version 2.3.2 or above.

Impact 5.3 MEDIUM

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N

Learn more about CVSS

Source file

npm/sanitize-html/CVE-2021-26540.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:14:43 +0000.