Repository navigation
feat(security): sanitizing untrusted HTML page - #310
Merged
Merged
Conversation
New spec page: sanitize untrusted HTML before it reaches the DOM — native Sanitizer API (Firefox 148, Chrome/Edge 146, early 2026; Safari not yet) with DOMPurify as the maintained fallback, paired with Trusted Types at the sink. Reciprocal relatedSlug on trusted-types, changelog entry, OG image, skill digest. From the Modern Web Guidance review.
added 2 commits
November 11, 2026 10:55
Review finding: native setHTML() sanitizes and inserts directly, returns nothing, and requires no Trusted Types policy — the page conflated it with the DOMPurify-plus-policy flow. Both the helper bullet and the native-API bullet now state the boundary.
# Conflicts: # public/.well-known/agent-skills/index.json # public/.well-known/agent-skills/specification-website/SKILL.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
New page from the Modern Web Guidance review: sanitizing untrusted HTML (security, recommended).
The practice is the requirement; the mechanism is the native Sanitizer API (
setHTML(), explicitSanitizerallowlist configurations) with DOMPurify as fallback. Support dated per the new currency rule: Firefox 148 and Chrome/Edge 146 shipped it in early 2026, Safari has not. Explicitly separates sanitizing from escaping, and pairs the page with trusted-types (source vs sink).Includes: changelog entry (dated 2026-11-11, re-date if it sits), reciprocal relatedSlug on trusted-types, OG image,
sign:skilldigest.Environment note, same as #306: only the new page's own OG image is committed; shared count images need a maintainer
npm run assets.