Skip to content

compare url attribute names case-insensitively when sanitizing#21430

Closed
rootvector2 wants to merge 1 commit into
emberjs:mainfrom
rootvector2:sanitize-url-attr-case
Closed

compare url attribute names case-insensitively when sanitizing#21430
rootvector2 wants to merge 1 commit into
emberjs:mainfrom
rootvector2:sanitize-url-attr-case

Conversation

@rootvector2
Copy link
Copy Markdown

checkURI and checkDataURI test the attribute name against the lowercase badAttributes lists with a strict match, so an upper- or mixed-case name like HREF or SRC never matches and the javascript:/vbscript: check in sanitizeAttributeValue is skipped. Attribute names are case-insensitive in HTML, and requiresSanitization already routes these elements through the sanitizer via the lowercased property name, so the value reaches the DOM unsanitized. Lower-case the name in both checks so mixed-case url attributes sanitize the same as lowercase ones.

checkURI and checkDataURI matched attribute names against the lowercase badAttributes lists with a strict comparison, so a mixed-case name such as HREF or SRC bypassed the javascript:/vbscript: protocol check even though requiresSanitization still routed the element through the sanitizer.
@NullVoxPopuli
Copy link
Copy Markdown
Contributor

I rebased over here: #21434 thank you!!! <3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants