Skip to content

Commit

Permalink
Add warning about lack of sanitization to HTML parsing methods
Browse files Browse the repository at this point in the history
This adds a warning similar to the one for the explicitly unsafe HTML parsing methods, to DOMParser and document.write()/writeln().
  • Loading branch information
lukewarlow committed Apr 10, 2024
1 parent f2089ab commit a9b07fb
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions source
Expand Up @@ -112287,6 +112287,9 @@ document.body.appendChild(frame)</code></pre>
</dd>
</dl>

<p class="warning">This method performs no sanitization to remove potentially-dangerous elements
and attributes like <code>script</code> or <span>event handler content attributes</span>.</p>

<div w-nodev>

<p><code>Document</code> objects have an <dfn>ignore-destructive-writes counter</dfn>, which is
Expand Down Expand Up @@ -112369,6 +112372,9 @@ document.body.appendChild(frame)</code></pre>
</dd>
</dl>

<p class="warning">This method performs no sanitization to remove potentially-dangerous elements
and attributes like <code>script</code> or <span>event handler content attributes</span>.</p>

<div w-nodev>

<p>The <dfn method for="Document"><code
Expand Down Expand Up @@ -112432,6 +112438,9 @@ dictionary <dfn dictionary>GetHTMLOptions</dfn> {
would be a standalone function. For parsing HTML, the modern alternative is <code
data-x="dom-parseHTMLUnsafe">Document.parseHTMLUnsafe()</code>.</p>

<p class="warning">This method performs no sanitization to remove potentially-dangerous elements
and attributes like <code>script</code> or <span>event handler content attributes</span>.</p>

<pre><code class="idl">[Exposed=Window]
interface <dfn interface>DOMParser</dfn> {
<span data-x="dom-DOMParser-constructor">constructor</span>();
Expand Down

0 comments on commit a9b07fb

Please sign in to comment.