Is chmod 757 safe?

戏子无情 提交于 2019-12-05 08:04:54

In a word, no. In two words, "hell. no!"

Let's interpret 757: that would be

  • owner: read write execute
  • groups that have permissions on the file: read - execute
  • the rest of the freaking world: read write execute

now, consider someone malicious uploading a short shell script:

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

Update

Aha, the "folder". Okay, here's the deal: if you don't have the execute bit set on a directory, that blocks searching the directory. The reason the host is asking you to do the world=RWX is that they aren't running the web server as you, so they're taking the simple and dumb route to fix it.

There are two possibilities here:

  • they have some scheme in place to make sure that the permission of uploaded files in that directory can't have the execute bit set

  • they don't and haven't gotten burned yet

Here's an article on what better methods are.

On the assumption that your hosts aren't fools, see what happens with 775.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!