跳到正文

Nginx配置失误 path_info 解析漏洞导致PHP任意代码执行(CVE-2013-4547)

严重 未验证 漏洞情报EXP 公开

漏洞描述

nginx是一款高性能的web服务器,使用非常广泛,其不仅经常被用作反向代理,也可以非常好的支持PHP的运行。

nginx中HTTP请求解析器在处理包含未转义空格字符的URI时存在安全漏洞,允许远程攻击者利用漏洞绕过某些配置中的安全限制。
如可以绕过如下配置的URL访问限制:
location /protected/ {
deny all;
}
通过请求"/foo /../protected/file"(静态文件,但foo后面有一个空格结尾)或采用如下配置:

location ~ \.php$ {
fastcgi_pass ...
}
通过请求"/file \0.php"可绕过限制,未授权访问受限资源。

解决建议

Nginx 1.5.7, 1.4.4已经修复该漏洞,建议用户下载更新:
http://www.nginx.org

参考链接

http://lists.opensuse.org/opensuse-security-announce/2013-12/msg00007.html
http://lists.opensuse.org/opensuse-updates/2013-11/msg00084.html
http://lists.opensuse.org/opensuse-updates/2013-11/msg00118.html
http://lists.opensuse.org/opensuse-updates/2013-11/msg00119.html
http://mailman.nginx.org/pipermail/nginx-announce/2013/000125.html
http://secunia.com/advisories/55757
http://secunia.com/advisories/55822
http://secunia.com/advisories/55825
http://www.debian.org/security/2012/dsa-2802