Skip to content

Commit 0426878

Browse files
committed
docs(select): note the direct HTMLElement sanitize pass must not be removed
1 parent 7f7d867 commit 0426878

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

core/src/utils/select-option-render.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,14 @@ const renderClonedContent = (id: string, content: HTMLElement, className: string
8686
const Tag = useSpan ? 'span' : 'div';
8787
const keyPrefix = `${className}-${id}`;
8888

89+
/**
90+
* Do not remove. This is the only sanitization pass for callers that pass
91+
* an `HTMLElement` straight to `renderOptionLabel` (e.g. vanilla JS)
92+
* without going through `getOptionContent`, which sanitizes upstream.
93+
* `cloneToVNode` does pure structural conversion and no security
94+
* filtering, so dropping this call would reopen an XSS hole on the
95+
* direct `HTMLElement` path.
96+
*/
8997
sanitizeDOMTree(content);
9098

9199
return (

0 commit comments

Comments
 (0)