HTTP/1.1 200 OK
Date: Sun, 31 Mar 2024 12:58:47 GMT
Server: Apache/2.2.8 (Ubuntu) DAV/2 mod_fastcgi/2.4.6 PHP/5.2.4-2ubuntu5 with Suhosin-Patch mod_ssl/2.2.8 OpenSSL/0.9.8g
X-Powered-By: PHP/5.2.4-2ubuntu5
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Content-Length: 118
Connection: close
Content-Type: text/xml; charset=utf-8
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><response>test??? Sorry, we don't have that movie :(</response>
if(isset($_GET["title"]))
{
// Creates the movie table
$movies = array("CAPTAIN AMERICA", "IRON MAN", "SPIDER-MAN", "THE INCREDIBLE HULK", "THE WOLVERINE", "THOR", "X-MEN");
// Retrieves the movie title
$title = $_GET["title"];
// Generates the XML output
header("Content-Type: text/xml; charset=utf-8");
// Generates the XML header
echo "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>";
// Creates the <response> element
echo "<response>";
// Generates the output depending on the movie title received from the client
if(in_array(strtoupper($title), $movies))
echo "Yes! We have that movie...";
else if(trim($title) == "")
echo "HINT: our master really loves Marvel movies :)";
else
echo xss($title) . "??? Sorry, we don't have that movie :(";
// Closes the <response> element
echo "</response>";
}
<img src='x'; onerror='alert(1)'>
function xss_check_3($data, $encoding = "UTF-8")
{
// htmlspecialchars - converts special characters to HTML entities
// '&' (ampersand) becomes '&'
// '"' (double quote) becomes '"' when ENT_NOQUOTES is not set
// "'" (single quote) becomes ''' (or ') only when ENT_QUOTES is set
// '<' (less than) becomes '<'
// '>' (greater than) becomes '>'
return htmlspecialchars($data, ENT_QUOTES, $encoding);
}
function xss_check_4($data)
{
// addslashes - returns a string with backslashes before characters that need to be quoted in database queries etc.
// These characters are single quote ('), double quote ("), backslash (\) and NUL (the NULL byte).
// Do NOT use this for XSS or HTML validations!!!
return addslashes($data);
}
<img src='x' onerror='alert(1)'>
<img src='' onerror='alert(1)'>
Leave a comment