-3

Given the following PHP...

<?php
 $name = $_GET['name'];
 echo "Welcome $name<br>";
      echo "Have Fun!";
                ?>

What kind of XSS vulnerability is this subject to: Stored, or Reflected?

My answer is: Non Persistent (reflected), but I am confused on how the index.php will be used as reflection when the user inputs the information.

user229044
  • 232,980
  • 40
  • 330
  • 338
KSDev
  • 11
  • 1
  • You asked "[which of the following] terms most precisely describe the vulnerability". You didn't *give us* the available terms, so who knows what the options are, but this is most precisely described as an XSS vulnerability. – ceejayoz Oct 10 '19 at 16:32
  • @ceejayoz There are different types of XSS, the use of "non-persistent" and "reflected" in the question indicates the user is looking for a classification of reflected (non-persisted) or stored (persisted). – user229044 Oct 10 '19 at 18:27

1 Answers1

2

It is reflected, or non-persisted, because the user input is not stored across requests, it is echoed back directly to the user in response to the request containing the XSS payload. The server "reflects" the users own input back at them.

A persistent XSS would be: A user signs up and commits an XSS paylod to some data store like a database, and that data is echoed back on a subsequent request. This type of XSS could allow one user to submit a payload that is executed on a different user's request.

user229044
  • 232,980
  • 40
  • 330
  • 338