Vulnerability library
Security checkApril 16, 2026

sanitize-html allowedTags Bypass via Entity-Decoded Text in nonTextTags Elements

Understand the exposure, see the recommended fix, and check whether your own website has related weaknesses.

Medium severitynpmsanitize-html

Check your website

Find this and other vulnerabilities with a free scan.

Your scan runs on your computer. No account required.

Description

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.

Recommendation

Update the sanitize-html package to the latest compatible version. Followings are version details:

  • Affected version(s): >= 2.17.2, < 2.17.3
  • Patched version(s): 2.17.3

References

Could your website be exposed too?

SmartScanner can check your website for sanitize-html allowedTags Bypass via Entity-Decoded Text in nonTextTags Elements and gives you actionable findings to investigate.

Start a free scan

Related Issues

See something that needs correcting? Let us knowUpdated April 16, 2026