sitesmith: harden HtmlBlock with DOMPurify + add Vitest setup
Closes XSS hole in HtmlBlock by sanitizing user/AI-supplied markup through DOMPurify before passing to dangerouslySetInnerHTML. Adds Vitest + jsdom for unit testing with 5 passing tests covering script stripping, on-event handler removal, javascript: URL blocking, iframe allowlist, and form/input stripping. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
3189
craft/package-lock.json
generated
Normal file
3189
craft/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user