Vulnerability library
Security checkOctober 21, 2026

ApostropheCMS sanitize-html: unbounded recursion when re-sanitizing the fallback of a discarded iframe (stack overflow,

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

Since 2.18.0, when an <iframe> is not allowed and disallowedTagsMode is 'discard' (the defaults), its raw-text content is re-sanitized by a recursive call to sanitizeHtml(text, options) (the change from #5564, fixing #5550). The recursion has no bound and starts each nested call with a fresh state. Two consequences, both absent from 2.17.

Recommendation

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

  • Affected version(s): >= 2.18.0, < 2.18.1
  • Patched version(s): 2.18.1

References

Could your website be exposed too?

SmartScanner can check your website for ApostropheCMS sanitize-html: unbounded recursion when re-sanitizing the fallback of a discarded iframe (stack overflow, and gives you actionable findings to investigate.

Start a free scan

Related Issues

See something that needs correcting? Let us knowUpdated October 21, 2026