为什么suhosin.executor.allow_symlink是一个安全问题


Why is suhosin.executor.allow_symlink a security issue?

我遇到了这个Can';t如果其中一个目录是符号链接,则在php中打开文件

suhosin文件称suhosin.executor.allow_symlink

当使用open_basedir时,此标志会重新激活symlink(),即默认情况下在Suhosin中禁用>=0.9.6。允许symlink()同时openbasedir的使用实际上是一种安全风险。

为什么会出现安全问题,如果设置为"关闭"或在open_basedir中使用根目录会发生什么?

符号链接使得"突破"Web服务器的DocumentRoot强加的伪chroot监狱变得微不足道。打开符号链接后,您可以指向服务器上的任何文件/目录,Web服务器会很高兴地跟随符号链接,永远不知道它已经脱离了DocumentRoot的限制。考虑一下如果你有会发生什么

ln -s /etc/shadow /www/docroot/index.html
ln -s /etc/passwd /www/docroot/index2.html