Skip to content

Instantly share code, notes, and snippets.

@refabr1k
Created March 1, 2023 14:55
Show Gist options
  • Save refabr1k/5bc94ece92bf5aacd3fce51c67f165a3 to your computer and use it in GitHub Desktop.
Save refabr1k/5bc94ece92bf5aacd3fce51c67f165a3 to your computer and use it in GitHub Desktop.
Intigriti - 2023-02-23 Can you spot the vulnerability?
<?php
if (isset($_GET['email']))
$email = filter_var($_GET['email'],
FILTER_SANITIZE_EMAIL);
if (isset($_GET['xss']))
$xss = htmlspecialchars($_GET['xss']);
if (isset($_GET['path'])) {
$path = $_GET['path'];
while (strpos($path, '../') !== false) {
$path = str_replace('../', '', $path);
if (isset($_GET['debug'])) {
echo '[DEBUG] Removed \'../\'. New path is ';
echo htmlspecialchars($path);
}}} ?>
<?php
header("content-security-policy:default-src 'none'");
?>
<h1>Sanitization as a Service</h1>
<p>We're revolutionizing the world of sanitization!
<br>Just submit the string you want sanitized,
and we'll do all the hard work!</p>
<h6>Here's your sanitized string:</h6>
<p>Email: <?php echo $email; ?></p>
<p>Xss: <?php echo $xss; ?></p>
<p>Path: <?php echo $path; ?></p>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment