Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Typeahead vulnerable to cross-site scripting attack #4181

Closed
RyanBard opened this issue Aug 10, 2015 · 4 comments
Closed

Typeahead vulnerable to cross-site scripting attack #4181

RyanBard opened this issue Aug 10, 2015 · 4 comments

Comments

@RyanBard
Copy link

Plunker showing XSS with onClick and onMouseOver: http://plnkr.co/edit/STR8SfgvtUdNopDS5Lam?p=preview

Plunker seems to protect against automatically running a script tag, but I was able to reproduce that locally -- the alert runs after the typeaheadHighlight filter's strong tag moved beyond the closing angle bracket of the script tag.

Previous issue: #3175

@unitymarc
Copy link

Your use case is similar to, but not identical to the one I created in #3175 . In our case, the vulnerability seemed to be caused by an artificial condition we were introducing (which is why I closed it). I'd agree that this is substantially different, and appears to be an exploitable attack vector.

@RyanBard
Copy link
Author

I wasn't careful about describing the script and strong tags and half of my comment got sanitized (I've now corrected this). I cross referenced the tickets.

@wesleycho
Copy link
Contributor

I suspected this was a potential problem, which is why #4073 exists. The problem at its core is the custom bind-html-unsafe directive, which is a bit of a hack - we are in the process of getting rid of this last vestige present in the typeahead component.

@wesleycho wesleycho added this to the 0.13.4 (Performance) milestone Aug 10, 2015
@wesleycho
Copy link
Contributor

This issue should now be fixed in master due to #4073 being resolved.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants