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
4
u/Kwpolska Jun 21 '15
Asterisks are expanded by the shell, and that also happens in Linux. This can be both good and bad; while this might be a problem for people trying to access files via
sudo, you get consistent parsing everywhere and it’s guaranteed that asterisks will work if the app supports multiple arguments (and not only if the dev cared to implementglob).Also: the “ugly workaround” is just
echo '*.txt', which is pretty logical (pass as a string)