Block copy-and-paste XSS via <noscript>
This patch is analogous to the WebKit patch for a common issue: https://trac.webkit.org/changeset/254800/webkit When sanitizing the clipboard markup in a dummy document, we disable scripting, and parse <noscript> in the script-disabled mode. Then we parse the sanitized markup in script-enabled mode when inserting it into the real document. This allows an XSS attack. This patch introduces a new flag to page settings that allows it to parse with the scripting flag enabled, while still disabling script execution. It also renames the |HTMLParserOptions::script_enabled| flag to |scripting_flag| to improve clarity and match the term in the HTML spec (https://html.spec.whatwg.org/#scripting-flag). Bug: 1065761 Change-Id: Ia4bd67a991b354eebd2cbfef6d3291230ddc1f6a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2128839Reviewed-by:Yoshifumi Inoue <yosin@chromium.org> Reviewed-by:
Kent Tamura <tkent@chromium.org> Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org> Cr-Commit-Position: refs/heads/master@{#754969}
Showing
Please register or sign in to comment