当前位置:WooYun >> 漏洞信息

漏洞概要 关注数(24) 关注此漏洞

缺陷编号:wooyun-2013-018116

漏洞标题:PHP safe_mode等安全配置绕过

相关厂商:PHP

漏洞作者: GaRY

提交时间:2013-01-30 16:00

修复时间:2013-02-04 16:08

公开时间:2013-02-04 16:08

漏洞类型:非授权访问/权限绕过

危害等级:中

自评Rank:10

漏洞状态:漏洞已经通知厂商但是厂商忽略漏洞

漏洞来源: http://www.wooyun.org,如有疑问或需要帮助请联系 [email protected]

Tags标签:

4人收藏 收藏
分享漏洞:


漏洞详情

披露状态:

2013-01-30: 细节已通知厂商并且等待厂商处理中
2013-02-04: 厂商已经主动忽略漏洞,细节向公众公开

简要描述:

在某些常见环境下的PHP执行环境,可以绕过其php.ini中设置的安全相关配置执行命令或者做其他操作

详细说明:

在PHP-FPM环境下的fastcgi运行的PHP中,因为PHP-FPM无法知晓我们的fastcgi请求来源于哪儿,因此我可以模仿fcgi协议向PHP-FPM发起伪造的请求。
而且PHP-FPM自从5.3.3开始,允许利用fcgi的参数PHP_VALUE, PHP_ADMIN_VALUE对php.ini的内容进行设置,因此可以利用此去覆盖原有php的安全设置。
但是因为disable_functions/classes的工作原理和其他配置有区别,通过这种方式我们无法覆盖这两个的配置,因此无法绕过disable_functions/classes。

漏洞证明:

利用结果如下:

fcgi.jpg

修复方案:

实际上这个还真不太好修复,可以暂时去除PHP_VALUE的支持,但是这只是一个临时方案,看PHP官方如何处理吧。
毕竟他无法解决“PHP-FPM无法知晓我们的fastcgi请求来源于哪儿”的问题。这又是一个架构上的问题了。

版权声明:转载请注明来源 GaRY@乌云


漏洞回应

厂商回应:

危害等级:无影响厂商忽略

忽略时间:2013-02-04 16:08

厂商回复:

最新状态:

2013-02-04:QUOTE: "[email protected]:Even if I don't understand why a person of sound mind would expose FPM to the internet (don't tell me it's because of the cloud, if that's the case, stop using clouds: it's not secure !), there's some case where this could be a security risk, I agree.How to fix this:1- add an option to php-fpm to disable the PHP_VALUE and PHP_ADMIN_VALUE fastcgi headers (default to disable).2- see if we can find a way of authenticate the client (the legitimate webserver) (is there a way from a php script to see the content of the fastcgi request headers ?, if not, the legitimate webserver can sent a password in the fastcgi headers to authenticate itself to FPM)3- both (1 & 2)"