upload security & permission

Discussions of secure PHP coding. Security in software is important, so don't be afraid to ask. And when answering: be anal. Nitpick. No security vulnerability is too small.

Moderator: General Moderators

Post Reply
aapalireza
Forum Newbie
Posts: 1
Joined: Sun Apr 21, 2013 3:26 am

upload security & permission

Post by aapalireza »

if i ignore directory execute permission, can i upload every file even .php,.exe,... ???
is there any risk whit is???
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: upload security & permission

Post by requinix »

The "execute" permission for directories is not actually for executing things. It's a misnomer.

Whatever the permission, someone can upload whatever files they want as long as your script allows it. If you don't want people to upload bad files then make sure they're only uploading good files (whatever those may be, like just images or just .doc files or whatever). What happens to uploaded files depends on your server configuration but in general yes: if they manage to upload a .php file then it can probably be executed just like any other PHP script you have.
User avatar
social_experiment
DevNet Master
Posts: 2793
Joined: Sun Feb 15, 2009 11:08 am
Location: .za

Re: upload security & permission

Post by social_experiment »

an interesting read OP, will shed some light on your thoughts about what can be done if no checking / restriction is in place for file uploads
https://www.owasp.org/index.php/Unrestr ... ile_Upload
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
Post Reply