Skip to content
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

Script Injection #52

Open
sfdavis opened this issue Dec 17, 2020 · 1 comment
Open

Script Injection #52

sfdavis opened this issue Dec 17, 2020 · 1 comment

Comments

@sfdavis
Copy link

sfdavis commented Dec 17, 2020

I ran into a weird issue with a client where I implemented Swiftype search. If something like the following query parameters were put in #stq=<script>window.location.replace('https%3A%2F%2Fgoogle.com')<%2Fscript>&stp=1 then the submitSearch function would execute the query parameter javascript. This example is fairly benign but it could be an issue for something more malicious. Adding "query = encodeURI(query); " after line 82 in the file jquery.swiftype.search.js appears to resolve the issue for me but I would not say I am sophisticated enough in Javascript security to know if this still leaves a vulnerability.

@arno-fukuda
Copy link

Great catch.
We've also discovered this and the provided workaround did the trick.

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

No branches or pull requests

2 participants