Skip to content

FF139 ExprFeat: Escape < and > in attributes when serialize HTML #39363

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

hamishwillee
Copy link
Collaborator

FF139 escapes < as &lt; and > as &gt; in attribute values when HTML is serialized (i.e. when reading Element.innerHTML, Element.outerHTML, Element.getHTML(), ShadowRoot.innerHTML, , ShadowRoot.getHTML().

This is the experimental features update.

Related docs can be tracked in #39309

@hamishwillee hamishwillee requested a review from a team as a code owner May 2, 2025 04:26
@hamishwillee hamishwillee requested review from dipikabh and removed request for a team May 2, 2025 04:26
@github-actions github-actions bot added Content:Firefox Content in the Mozilla/Firefox subtree size/s [PR only] 6-50 LoC changed labels May 2, 2025
Copy link
Contributor

github-actions bot commented May 2, 2025

Preview URLs

Flaws (1)

URL: /en-US/docs/Mozilla/Firefox/Experimental_features
Title: Experimental features in Firefox
Flaw count: 1

  • broken_links:
    • Can't resolve /en-US/docs/Web/API/HTML_Sanitizer_API
External URLs (1)

URL: /en-US/docs/Mozilla/Firefox/Experimental_features
Title: Experimental features in Firefox

(comment last updated: 2025-05-05 00:14:05)

Copy link
Contributor

@dipikabh dipikabh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Comment on lines 1114 to 1116
This prevents certain exploits where HTML is serialized and then injected back into the DOM.
The affected methods and properties are: {{domxref("Element.innerHTML")}}, {{domxref("Element.outerHTML")}}, {{domxref("Element.getHTML()")}}, {{domxref("ShadowRoot.innerHTML")}}, and {{domxref("ShadowRoot.getHTML()")}}.
([Firefox bug 1941347](https://bugzil.la/1941347))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same suggestions as in #39364 (review)
And don't miss the period at the end after the bug link :)

@hamishwillee hamishwillee merged commit 43254b2 into mdn:main May 5, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:Firefox Content in the Mozilla/Firefox subtree size/s [PR only] 6-50 LoC changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants