Skip to content

base element unsafe in default sanitizer configuration#44697

Merged
chrisdavidmills merged 4 commits into
mainfrom
hamishwillee-base-sanitizer
Jul 13, 2026
Merged

base element unsafe in default sanitizer configuration#44697
chrisdavidmills merged 4 commits into
mainfrom
hamishwillee-base-sanitizer

Conversation

@hamishwillee

@hamishwillee hamishwillee commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

Fixes #44673

The <base> element is now explicitly marked as unsafe in whatwg/html#12664 (rather than "uncategorized"). This updates the https://developer.mozilla.org/en-US/docs/Web/API/HTML_Sanitizer_API/Default_sanitizer_configuration list to add it to the list of explicitly unsafe elements.

I also noted that some elements are removed by default because they are deprecated, not necessarily attack vectors. This is the case for elements like <acronym>.

The actual default configuration has not changed, since base was already omitted as a potential attack.

I also updated Sanitizer/removeUnsafe() with the needed change, but we shouldn't merge this until the BCD goes in

@hamishwillee hamishwillee requested a review from a team as a code owner July 13, 2026 01:05
@hamishwillee hamishwillee requested review from chrisdavidmills and removed request for a team July 13, 2026 01:05
@github-actions github-actions Bot added Content:WebAPI Web API docs size/xs [PR only] 0-5 LoC changed labels Jul 13, 2026
@github-actions

github-actions Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Preview URLs (2 pages)

(comment last updated: 2026-07-13 01:42:36)

Comment thread files/en-us/web/api/html_sanitizer_api/default_sanitizer_configuration/index.md Outdated
@github-actions github-actions Bot added size/s [PR only] 6-50 LoC changed and removed size/xs [PR only] 0-5 LoC changed labels Jul 13, 2026
@hamishwillee hamishwillee marked this pull request as draft July 13, 2026 01:11
@hamishwillee hamishwillee marked this pull request as ready for review July 13, 2026 01:16

@chrisdavidmills chrisdavidmills left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM; thanks, @hamishwillee!

@chrisdavidmills chrisdavidmills merged commit cb84bb5 into main Jul 13, 2026
13 checks passed
@chrisdavidmills chrisdavidmills deleted the hamishwillee-base-sanitizer branch July 13, 2026 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:WebAPI Web API docs size/s [PR only] 6-50 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

<base> is now unsafe in the Sanitizer API

3 participants