Is chmod 757 safe?

As I am on a shared host, I want to add a script image hosting and it seems that since 755 it does not allow uploading images, so I changed the folder to 757, is chmod safe to 757

+6
source share
1 answer

In a word, no. In a nutshell: "Hell, no!"

Let it interpret 757: it will be

  • owner: read write execute
  • groups with file permissions: read-execute
  • rest of the weird world: read the record run

Now think about some malicious loading of a short shell script:

#!/bin/sh -- rm -rf / 

Update

Yeah, the folder. Well, here's the deal: if you don't have a run bit set in the directory that blocks the search in the directory. The reason the host asks you to make the world = RWX is because they don’t manage the web server like you do, so they take a simple and dumb route to fix it.

There are two possibilities:

  • they have some scheme to make sure that the resolution of the downloaded files in this directory cannot have the execution bit set

  • they have not and have not yet been burned.

Here's an article on what the best methods are.

Assuming your hosts aren't stupid, see what happens with 775.

+13
source

Source: https://habr.com/ru/post/885832/


All Articles