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
{{ message }}
Repository navigation
artifact-canvas: relax HTML policy to html:true + DOMPurify (render safe static HTML) #1042
The artifact-canvas renderer uses markdown-it html: false (spir-945 spec D7) as XSS
defense-layer-1, with DOMPurify as layer-2. Side effect: all raw HTML in a document is escaped to
visible text, so specs/plans/reviews can't use raw HTML tags — <img>, <details>/<summary>, <kbd>, <sub>/<sup>, HTML tables, alignment wrappers, etc. all render as literal angle-bracket
text. (Standard markdown  images still work; this is specifically about raw HTML tags.)
Proposal
Relax the renderer to html: true + DOMPurify as the sole raw-HTML guard. DOMPurify already
strips the dangerous surface — <script>, event-handler attributes (onerror=, onclick=…), javascript: / data: URLs — while keeping safe static HTML. Net: richer rendering, same XSS
protection (DOMPurify, plus the webview's nonce-based script-src CSP, which blocks inline script
regardless of the markdown-it setting).
Explicitly still blocked (by design)
JavaScript and interactive elements supplied by document content. Executing a document's embedded
JS in a review surface is the exact XSS vector; DOMPurify + CSP strip it. This issue is about safe static HTML only — not running document-supplied scripts.
Spec impact
Amends spir-945 D7 (html: false + DOMPurify → html: true + DOMPurify as the guard). This is
a cross-host change: every surface that mounts the canvas inherits it.
Shipped as part of PR #1045 / pir-859 (commit 689abd2). The artifact-canvas renderer now uses html: true + DOMPurify with the policy locked in packages/artifact-canvas/src/renderer/sanitization.ts. Recorded as a D7 amendment in the #859 plan addendum and in spir-945's review. Closing.
Activity
[PIR #859] artifact-canvas: strip comments pre-parse (fix #1036/split…
[PIR #859] Plan/thread: package render-fix scope expansion (#1036/#1042)
amrmelsayed commentedon Jun 14, 2026
Shipped as part of PR #1045 / pir-859 (commit 689abd2). The artifact-canvas renderer now uses
html: true+ DOMPurify with the policy locked inpackages/artifact-canvas/src/renderer/sanitization.ts. Recorded as a D7 amendment in the #859 plan addendum and in spir-945's review. Closing.