0

This question already has an answer here:

I have the following javaScript code in an application, which BURP flags as being possibly vulnerable. However, i have had no luck trying to get it to execute.

var hash = window.location.hash; if(hash){ $('a[href="'+ hash +'"]')[0].click(); }

enter image description here

Is the above code vulnerable and if so, what sort of URL fragment can execute it?

marked as duplicate by Alexander O'Mara, Steffen Ullrich, Xander, Rory Alsop Dec 14 '18 at 15:59

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • I don't think there's enough information to know here. It's possible your input might be getting escaped elsewhere too. – securityOrange Dec 7 '18 at 4:31
  • Please do not post text in images. It is hard to search and bad for accessibility. Instead, copy paste the actual text into your question. – Anders Dec 12 '18 at 12:00
  • Also, what version of jQuery are you using? I am assuming $ is jQuery here? – Anders Dec 12 '18 at 12:03
0

Assuming that the only relevant code is what has been highlighted above, then as Burp notes at the end, you need to determine what version of jQuery is being used. If the page uses a version of jQuery below 1.6.3, then you can exploit this sink in Edge with #"]<img src=x onerror=alert(1)>.

Not the answer you're looking for? Browse other questions tagged or ask your own question.