You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Wire DOMPurify into the admin editor with the configuration from doc 13 §4.3 and integrate Trusted Types so innerHTML sinks only accept TrustedHTML values. Editor surfaces that accept paste/HTML-import call sanitizePasted(html) which returns a TrustedHTML via RETURN_TRUSTED_TYPE: true. The admin CSP (issue #59) enforces require-trusted-types-for 'script' so any unsanitized assignment fails closed.
Design reference
docs/13-security-baseline.md §4.3 (DOMPurify in the editor)
Summary
Wire DOMPurify into the admin editor with the configuration from doc 13 §4.3 and integrate Trusted Types so
innerHTMLsinks only acceptTrustedHTMLvalues. Editor surfaces that accept paste/HTML-import callsanitizePasted(html)which returns aTrustedHTMLviaRETURN_TRUSTED_TYPE: true. The admin CSP (issue #59) enforcesrequire-trusted-types-for 'script'so any unsanitized assignment fails closed.Design reference
Acceptance criteria
frontend/admin/sanitize.tsexportssanitizePasted(html: string): TrustedHTMLUSE_PROFILES: { html: true }, FORBID_TAGS (style, form, input, iframe, frame, object, embed), FORBID_ATTR (onerror, onload, onclick, onmouseover, onfocus, onblur),ALLOW_DATA_ATTR: false,RETURN_TRUSTED_TYPE: truesanitizePastedbefore insertioninnerHTMLwrites in admin use theTrustedHTMLvalueinnerHTMLin admin fails the Trusted Types check in test browserinnerHTML =assignments without sanitizerDependencies
#59
Complexity
M