I recently came across a website that generates a random adjective, surrounded by a prefix and suffix entered by the user. For example, if the user enters “123” for prefix, and “789” for suffix, it might generate “123Productive789”. I’ve been screwing around with it, and I thought I might try something out. I entered this into the prefix field:
<a href="javascript:window.close();">Click</a><hr />
And, sure enough, I was given the link, then an <hr>
, then a random adjective. What I’m wondering is, could this be dangerous? There must be many more websites out there that have this issue, are all of them vulnerable to some sort of php injection?
7
It would appear that this site is vulnerable to a cross-site scripting attack (XSS). XSS is a reasonably common and potentially significant security vulnerability.
Of course, what an attacker can accomplish by using an XSS attack will depend heavily on the nature of the site itself. An XSS vulnerability on a banking site is likely to lead to many more attacks than an XSS vulnerability on a toy web app that has no logins and has no user data.