JavaScript Code Vulnerability Fix: Important Steps You Need to Know
P粉463418483
P粉463418483 2023-09-20 14:49:09
0
4
648

I'm not the strongest JS user, but I need it and wrote some code for my web page that works on Apache and PHP. In my ajax request I have the following code:

if (dataX['var1'] == '1.1' || dataX['var1'] == '2.1') { window.location.href = '' }

If I use XSStrike to check for potential vulnerabilities on my system, I get messages that may be injectable.

Can someone help me fix it? Do I need like a freeze or something to fix it? Sorry, I don't know how an attacker can use this. Thanks for any helpful help. good luck.

What have I tried? I tried asking on that channel? !

P粉463418483
P粉463418483

reply all (4)
P粉739079318

Ifcan contain arbitrary unchecked strings, then if an attacker has previously successfully saved any string they wanted as "domain", they will gain access to your page scope . In this case, it's highly questionable what they could do except redirect to their server, since the code inwon't be executed due to the page change. I'm not sure about a location

window.location.href = '';executeSomethingNasty()
Or just change the hash
window.location.href = window.location.href+'#stayonthepage';executeSomethingNasty()
    尊渡假赌

    Such an answer

      Latest Downloads
      More>
      Web Effects
      Website Source Code
      Website Materials
      Front End Template
      About us Disclaimer Sitemap
      php.cn:Public welfare online PHP training,Help PHP learners grow quickly!