Repository navigation
fix(security): treat as and is as the element's tag - #603
Conversation
Architecture Data flow No data-flow sequence changed in this PR. Review ✨ Nothing flagged · reviewed Tip Open a diagram on the canvas, then press W or click play to walk through the change one step at a time 🪧 More tips
Thanks for using PR Lens! It's free for OSS. If it helped, a star helps other teams find it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Documentation previews📚 Preview all documentation changes (follows new pushes) Pinned to the current head: |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
An element whose `as` or `is` names a blocked or not-allowed tag is now removed or passed to tagFallback, and its props are validated for that tag. The element's own tag is still checked, as renderers fall back to it. `as` and `is` must be literal strings of letters, digits, `_` and `-`. Bound selectors (`:as`, `v-bind:is`) and object bindings that can set them are stripped. Amp-Thread-ID: https://ampcode.com/threads/T-01a1e96f-e90f-749c-89b5-4a49d93eadd0 Co-authored-by: Ahad Birang <farnabaz@gmail.com>
38b5b00 to
46da220
Compare
comark
@comark/angular
@comark/ansi
@comark/html
@comark/nuxt
@comark/react
@comark/svelte
@comark/vue
commit: |
Written by an AI agent (Amp) on behalf of @farnabaz, who directed the change.
The security plugin now treats
asandisas the tag the element renders as, instead of only stripping a bad value.asorisnames a blocked tag, or a tag outsideallowedTags, is removed or passed totagFallback, like an element with that tag. Its props are validated for the named tag, soas="object"drops them all.as. Without this,<iframe as="x">would get pastblockedTags: ['iframe'].asandismust be literal strings matching[A-Za-z0-9_-]+. Anything else is stripped (spaces,<script>,a.b, empty strings).:as,v-bind:as,:is,v-bind:is(JSON strings included), variants likeASor.is, and object bindings (v-bind,v-bind:,:) that containas/isor come from render-time data.Behavior change: the alert plugin sets
ason blockquotes (as: 'note', …). WithallowedTags, alerts are now removed unless their type names are allowed too.Frontmatter sanitizing is unchanged.
Checks run:
comarktests (2110 passed, 4 skipped), the Vue bound-props tests,pnpm test:sanitizer,pnpm typecheck, oxlint, oxfmt, and the docs linter.Summary by CodeRabbit
asorisvalues against blocked and allowed tag lists.asorisare stripped.as,is,tag, bindings, and component-like values.