Skip to content

馃悰 purify item template output in bento-autocomplete - #40540

Open
madib06ops wants to merge 1 commit into
ampproject:mainfrom
madib06ops:bento-autocomplete-purify
Open

馃悰 purify item template output in bento-autocomplete#40540
madib06ops wants to merge 1 commit into
ampproject:mainfrom
madib06ops:bento-autocomplete-purify

Conversation

@madib06ops

Copy link
Copy Markdown
Contributor

checkPropsPostMutations renders each suggestion with mustache and writes the result into the DOM through dangerouslySetInnerHTML, but mustache only escapes interpolated values so its output is not a sanitization boundary, and the suggestion data can come from a remote src fetch. A response item like {"name": ""} rendered through a {{{name}}} template runs its handler in the component shadow root. This routes the rendered markup through the AMP Purifier before insertion, the same way amp-mustache and amp-autocomplete sanitize template output.

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