Let's say I have the following code:
//--get the value that was passed in via a query string parameter
var passedInQueryStringValue = getQueryStringValueFor("someKey");
//--append the value to the window.location as such:
window.location = "https://example.com?q=" + passedInQueryStringValue ;
Is this susceptible to XSS (or any other attack for that matter)? Let's assume that example.com properly handled whatever value for q gets sent over as that isn't the part I'm interested in here.
Something feels fishy here but I'm not positive there is a vulnerability.