Vulnerability library
Security checkMarch 14, 2025

JS Html Sanitizer allows XSS when used with contentEditable

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

Check your website

Find this and other vulnerabilities with a free scan.

Your scan runs on your computer. No account required.

Description

XSS vulnerability when the sanitizer is used with a contentEditable element to set the elements innerHTML to a sanitized string produced by the package. If the code is particularly crafted to abuse the code beautifier, that runs AFTER sanitation.

Recommendation

Update the @jitbit/htmlsanitizer package to the latest compatible version. Followings are version details:

  • Affected version(s): < 2.0.3
  • Patched version(s): 2.0.3

References

Could your website be exposed too?

SmartScanner can check your website for JS Html Sanitizer allows XSS when used with contentEditable and gives you actionable findings to investigate.

Start a free scan

Related Issues

See something that needs correcting? Let us knowUpdated March 14, 2025