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

CVE-2026-40186: sanitize-html allowedTags Bypass via Entity-Decoded Text in nonTextTags Elements

April 16, 2026

Commit 49d0bb7 introduced a regression in sanitize-html that bypasses allowedTags enforcement for text inside nonTextTagsArray elements (textarea and option). Entity-encoded HTML inside these elements passes through the sanitizer as decoded, unescaped HTML, allowing injection of arbitrary tags including XSS payloads. This affects any application using sanitize-html that includes option or textarea in its allowedTags configuration.

References

  • github.com/advisories/GHSA-9mrh-v2v3-xpfm
  • github.com/apostrophecms/apostrophe
  • github.com/apostrophecms/apostrophe/commit/7ca2d16237c72718ef7e5c7ae0458e6027ac4f64
  • github.com/apostrophecms/apostrophe/security/advisories/GHSA-9mrh-v2v3-xpfm
  • nvd.nist.gov/vuln/detail/CVE-2026-40186

Code Behaviors & Features

Detect and mitigate CVE-2026-40186 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 starting from 2.17.2 before 2.17.3

Fixed versions

  • 2.17.3

Solution

Upgrade to version 2.17.3 or above.

Impact 6.1 MEDIUM

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

Learn more about CVSS

Weakness

  • CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

Source file

npm/sanitize-html/CVE-2026-40186.yml

Spotted a mistake? Edit the file on GitLab.

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

Page generated Sat, 09 May 2026 12:18:22 +0000.