-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
XSS in soho-autocomplete #502
Comments
Did you try to reproduce this in EP by updating this example? https://github.com/infor-design/enterprise/blob/master/app/views/components/autocomplete/test-xss-security.html i was playing around with it but cant seem to reproduce this. That would make this issue easier to resolve as this should be a core EP issue I would think. |
I can reproduce it in EP, though not with the same index.html: <div class="row">
<div class="twelve columns">
<div class="field">
<label for="autocomplete">XSS Test Autocomplete</label>
<input type="text" id="autocomplete" class="autocomplete">
</div>
</div>
</div>
<script src="index.js"></script> index.js: $("#autocomplete").autocomplete({
source: [
"Hello",
`<script>window.alert('autocomplete xss')</script>XSS"><script>window.alert('autocomplete xss')</script>XSS`,
"World",
]
}) |
I’m also trying the same. So far no luck but not giving up yet. I do have it reproducible in NG. If we do need to patch an NG I guess that would be a 5.3.1 since 5.3 runs 4.18.1. But still checking on where it would be solved |
I just tested with a similar source to your dropdown example in the other ticket. See edited comment above |
Where you able to get this to run in the EP sample app? i keep getting "Uncaught SyntaxError: Invalid or unexpected token" |
Got it! Working on a fix |
Describe the bug
Script tags that are in a
soho-autocomplete
search result are executed when searching for the tag. This happens with and without a custom template.To Reproduce
Given the following component:
Steps to reproduce the behavior:
<
character in the search fieldExpected behavior
The script is not executed in Step#2
Version
Platform
Tested in Chrome on Windows & Safari on MacOS.
Additional context
Repro: https://anhallbe.github.io/ids-repro/autocomplete-xss though I'm having some issues with deploying on GH Pages.
Source code here: https://github.com/anhallbe/ids-repro/tree/master/src/app/autocomplete-xss
The problem only occurs when searching for the script tag, e.g
<script
. It does not occur when searching for the other contents of thesource
. Possibly related to result highlighting?The text was updated successfully, but these errors were encountered: