Skip to content

Commit 43254b2

Browse files
authored
FF139 ExprFeat: Escape < and > in attributes when serialize HTML (#39363)
* FF139 ExprFeat: Escape < and > in attributes when serialize HTML * Apply suggestions from code review
1 parent 2cdde96 commit 43254b2

File tree

1 file changed

+43
-0
lines changed
  • files/en-us/mozilla/firefox/experimental_features

1 file changed

+43
-0
lines changed

files/en-us/mozilla/firefox/experimental_features/index.md

+43
Original file line numberDiff line numberDiff line change
@@ -1108,6 +1108,49 @@ The [HTML Sanitizer API](/en-US/docs/Web/API/HTML_Sanitizer_API) allow developer
11081108
</tbody>
11091109
</table>
11101110

1111+
### Escape < and > in attributes when serializing HTML
1112+
1113+
Firefox replaces the `<` and `>` characters with `&lt;` and `&gt;` (respectively) in attributes when serializing HTML.
1114+
This prevents certain exploits where HTML is serialized and then injected back into the DOM.
1115+
The affected methods and properties are: {{domxref("Element.innerHTML")}}, {{domxref("Element.outerHTML")}}, {{domxref("Element.getHTML()")}}, {{domxref("ShadowRoot.innerHTML")}}, and {{domxref("ShadowRoot.getHTML()")}}.
1116+
([Firefox bug 1941347](https://bugzil.la/1941347)).
1117+
1118+
<table>
1119+
<thead>
1120+
<tr>
1121+
<th>Release channel</th>
1122+
<th>Version added</th>
1123+
<th>Enabled by default?</th>
1124+
</tr>
1125+
</thead>
1126+
<tbody>
1127+
<tr>
1128+
<th>Nightly</th>
1129+
<td>139</td>
1130+
<td>Yes</td>
1131+
</tr>
1132+
<tr>
1133+
<th>Developer Edition</th>
1134+
<td>139</td>
1135+
<td>No</td>
1136+
</tr>
1137+
<tr>
1138+
<th>Beta</th>
1139+
<td>139</td>
1140+
<td>No</td>
1141+
</tr>
1142+
<tr>
1143+
<th>Release</th>
1144+
<td>139</td>
1145+
<td>No</td>
1146+
</tr>
1147+
<tr>
1148+
<th>Preference name</th>
1149+
<td colspan="2"><code>dom.security.html_serialization_escape_lt_gt</code></td>
1150+
</tr>
1151+
</tbody>
1152+
</table>
1153+
11111154
### Removal of MutationEvent
11121155

11131156
{{domxref("MutationEvent")}} and its associated events (`DOMSubtreeModified`, `DOMNodeInserted`, `DOMNodeRemoved`, `DOMCharacterDataModified`, `DOMAttrModified`) are on the path for removal, and have been disabled on nightly.

0 commit comments

Comments
 (0)