Describe the bug
Script tags inside dropdown options are executed when removing search text using backspace.
To Reproduce
Given the following component:
<select soho-dropdown [(ngModel)]="selected">
<option *ngFor="let option of options" [value]="option">{{option}}</option>
</select>
@Component({
selector: 'app-dropdown-xss',
templateUrl: './dropdown-xss.component.html',
styleUrls: ['./dropdown-xss.component.css']
})
export class DropdownXssComponent {
selected = 'Hello';
options = [
{
label: `<script>window.alert('xss')</script>XSS`,
value: `<script>window.alert('xss')</script>XSS`,
];
}
Steps to reproduce the behavior:
Expected behavior
The script should not execute.
Version
Platform
Tested in Chrome & Firefox on Windows.
Additional context
Related: https://github.com/infor-design/enterprise-ng/issues/503
I can reproduce it on the current master branch of the enterprise-ng project by making the following changes:
noSearch from the line with <select soho-dropdown in dropdown-simple.htmlQA Failed.
Unable to select values with double quotes "
Icon color is distorted in responsive view

Additionally, in http://master-enterprise.demo.design.infor.com/components/dropdown/test-xss.html, searching some characters returns results that are not part of the list.



All the issues found above are now fixed across all browsers except for the selecting of "Value Contains escaped "quote"" and "it has "dbl quotes"" using Enter key in http://4230-beta0-enterprise.demo.design.infor.com/components/dropdown/test-special-chars.html.
Steps:
Should we make separate ticket/issue for that @tmcconechy ?
I think this is fine as failed QA as that case isnt working.
This issue is now resolved. Moving this to Done bucket.