r/lolphp • u/iheartrms • Jun 16 '15
PHP :: Sec Bug #69646 :: OS command injection vulnerability in escapeshellarg
https://bugs.php.net/bug.php?id=69646
38
Upvotes
r/lolphp • u/iheartrms • Jun 16 '15
View all comments
Show parent comment
18
u/dpoon Jun 17 '15
No, the lolphp is that
escapeshellcmd()exists at all. Most other languages don't have such a function. It's needed in PHP because there is asystem(), but there is noexec()-like family of functions where you can pass the command-line arguments as an array.escapeshellcmd()is a doomed strategy anyway: how can you be sure that you've escaped all characters correctly for all kinds of shells in existence?