HTML passed to this library must be treated as untrusted input.
- Use a sandboxed iframe. The smallest useful policy is usually
sandbox="allow-scripts"withoutallow-same-origin. - Validate
MessageEvent.sourceagainst the iframe'scontentWindowbefore accepting any bridge message. - Validate message payloads again in the host. Message names are routing hints, not authorization.
- Keep file, process, credential, clipboard, payment, and network authority outside the iframe.
- Pass external navigation through
normalizeHtmlArtifactExternalUrlor an equally strict host policy. - Apply a Content Security Policy appropriate for the host's threat model.
The generated iframe shell reports runtime errors but does not grant host capabilities. Its postMessage bridge is a request channel only.
Please avoid filing public exploit details before a fix is available. Contact the maintainer through the security reporting channel on the GitHub repository.