by jamroom · 12y ago · 0 comments
"Of course one means of mitigating this particular attack vector is simply to disable any CGI functionality that makes calls to a shell"
If you're on Ubuntu:
a2dismod cgi
service apache2 restart
If you're NOT running any CGI scripts this will disable CGI support in Apache. Not sure if that takes care of things 100%, but might be helpful.All this has made me a bit nervous though. I certainly didn't change the system to use bash instead of dash.
system("echo 'hello world'");
then I believe you are OK. But that's "security 101" and you should never be opening a system call to user input.This is not required for exploiting the vulnerability at hand.
exploiter -> machine -> conduit (in this case, a web server) -> bash command through scripting language
but that doesn't really make sense to me. if it's in the header as a cookie header, in php that would require something like this:
$someVar = $_COOKIE['somecookiekey']; exec($someVar);
this is a super fringe case, and wouldn't warrant this big of a deal. for this to be a 10/10 issue, it has to mean that processing the header files in Nginx/Apache results in some buffer overflow or for those values to be directly fed to bash.
otherwise the risk is super minimal, so I don't think it's a matter of making system/exec calls on user-supplied data.