ipfspics/ipfspics-server

Fix security issues (RCE)

kpcyrd opened this issue · 4 comments

I've quickly looked over the code for some minutes and got limited code execution on your server, please have a look at https://secure.php.net/manual/en/function.escapeshellarg.php and some best practises in general.

As I mentioned earlier every user input is verified at the beginning of the script and it exits if it's not valid. It's not currently vulnerable, but your proposition is a better practice.

I will definitely implement this.

@cloutier The filter is bypassable. I've actually tested this on your server.

@kpcyrd Can you send me what query you used? vincent1cloutier@gmail.com

I don't have access to my mails right now, I'm going to send it to you within a few hours.

preg_match('/^[a-z0-9]+$/i', ... also mitigates the issue, I recommend this as a hotfix.