Skip to content

feat(security): sanitizing untrusted HTML page - #310

Merged
jdevalk merged 3 commits into
mainfrom
add/sanitizer-api
Nov 11, 2026
Merged

jdevalk merged 3 commits into
mainfrom
add/sanitizer-api

Conversation

@jdevalk

@jdevalk jdevalk commented Nov 11, 2026

Copy link
Copy Markdown
Owner

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(), explicit Sanitizer allowlist 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:skill digest.

Environment note, same as #306: only the new page's own OG image is committed; shared count images need a maintainer npm run assets.

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.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Deploying specification-website with  Cloudflare Pages  Cloudflare Pages

Latest commit: 29f00c2
Status:⚡️  Build in progress...

View logs

Riff 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
@jdevalk
jdevalk marked this pull request as ready for review November 11, 2026 10:04
@jdevalk
jdevalk merged commit 519b057 into main Nov 11, 2026
1 check was pending
@jdevalk
jdevalk deleted the add/sanitizer-api branch November 11, 2026 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant