Deployable-PHP-Codepad icon indicating copy to clipboard operation
Deployable-PHP-Codepad copied to clipboard

Project is unsafe - bad code paste can crash server

Open ghost opened this issue 13 years ago • 2 comments

I was testing the codepad on viper-7 and inadvertently locked up the web server when seeing what it was capable of (your readme mentions "And the other, "Worker", which runs inside the jail as the jailexec user, and executes pastes via a mock CGI interface, where security is no problem, and so where the entire request/response transaction, shell environment, php extensions, and even custom php.ini's are all fair game ") via a code snippet similar to the following (in my snippet I was trying to test how your codepad handled fork recursion - apparently it doesn't).

To reproduce, run something similar to this in a paste:

ghost avatar Aug 29 '13 03:08 ghost

The Codepad will leave that process running for anything up to 30 minutes, while limiting the number of forks it can spawn (provided on an environment level by kernel user limits). During that time it will no longer accept requests from your client or host, but is still quite online for other users. Additionally, In the worst case the system will self reset if the machine is truly unreachable from a remote host for longer than 5 minutes.

Thank you for your feedback, but the system is quite safe :)

Viper-7 avatar Sep 02 '13 04:09 Viper-7

Viper-7 that's good to hear - however, your site in particular was down, I verified with 5+ other users in #php on irc, as well as the site isup.me (which confirmed it was down during the time period).

Thanks.

ghost avatar Sep 04 '13 02:09 ghost