Docs: closed shadow roots are not protected (#164 follow-up)#168
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
The shadow-DOM piercing PRs (Tiers 1–3) covered open shadow roots.
Closed roots (`attachShadow({ mode: "closed" })`) are opt-out of all
external JavaScript access by spec — `host.shadowRoot` is null,
adoptedStyleSheets and MutationObserver don't cross the boundary,
and no supported API undoes that.
Add a short Coverage Scope section to the Rules page documenting
this gap. The phrasing stays abstract about what an attacker could
hide there (no injection-pattern examples in published docs, per
the project convention).
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
5eeb7e6 to
c6d8b69
Compare
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.
Summary
attachShadow({ mode: "closed" })) are opt-out of all external JavaScript access by spec —host.shadowRootis null,MutationObserverandadoptedStyleSheetsdon't cross the boundary, and no supported API undoes that.Closes #164 entirely (Tiers 1–3 + the docs limitation note).
What changed
docs/src/content/docs/rules.md— new Coverage Scope subsection that calls out open-shadow-root reachability (what works) and closed-shadow-root opacity (what doesn't). Phrasing stays abstract about what an attacker could plant there, in line with the project's "no prompt-injection examples in published docs" convention.Test plan
bun run check— Astro typecheck clean.bun run build— docs site builds clean (8 pages).🤖 Generated with Claude Code