Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

mdAutocomplete: XSS vulnerability #2901

@chr22

Description

@chr22

You generate HTML from a string to highlight the matching part of the search string in the result.

https://github.com/angular/material/blob/master/src/components/autocomplete/js/highlightController.js#L11

If the search result is this as a string:
capture

and you search for "x" then the resulting output is this, with a real script-tag that gets executed:
capture1

I cant create a CodePen because it won't let me insert a script tag in a javascript string.

I can see that you have some sort of sanitizing with a RegEx, that i cant decipher.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions