剖析与更新修复Nginx漏洞的方法
一 、此次漏洞分析
1 nginx HTTP/2漏洞
[nginx-announce] nginx安全公告(CVE-2018-16843,CVE-2018-16844)
在nginx HTTP / 2实现中发现了两个安全问题,
漏洞对服务器的影响:
可能会导致过多的内存消耗(CVE-2018-16843)和CPU使用率(CVE-2018-16844)。
影响范围:
这些问题会影响使用ngx_http_v2_module编译的nginx(不是默认情况下编译)如果“listen”指令的“http2”选项是用于配置文件。
影响版本:
这些问题会影响nginx 1.9.5 - 1.15.5。
解决方法:
问题在nginx 1.15.6,1.14.1中得到修复。建议升级到最新稳定版
以上内容参考:
http://mailman.nginx.org/pipermail/nginx-announce/2018/000220.html
2 ngx_http_mp4_module漏洞
[nginx-announce] nginx安全公告(CVE-2018-16845)
漏洞对服务器的影响:
在ngx_http_mp4_module中发现了一个安全问题,可能是这个问题允许攻击者在工作进程中导致无限循环,导致攻击工作进程崩溃,或者可能导致工作进程内存使用特制的mp4文件(CVE-2018-16845)进行披露。
影响范围:
如果使用ngx_http_mp4_module构建,则该问题仅影响nginx(默认情况下不构建模块)并使用“mp4”指令配置文件。此外,只有在攻击时才能进行攻击,攻击者能够触发特制的mp4文件的处理使用ngx_http_mp4_module。
影响版本:
该问题影响nginx 1.1.3 +,1.0.7 +。
解决方法:
该问题在1.15.6,1.14.4中得到修复。建议升级到最新稳定版
该问题的补丁可以在这里找到:
http://nginx.org/download/patch.2018.mp4.txt
以上内容参考:
http://mailman.nginx.org/pipermail/nginx-announce/2018/000221.html
3 模块ngx_http_mp4_module介绍
作用:为H.264(一种视频编码格式)/AAC(一种音频编码格式)文件,主要是以 .mp4、.m4v、和.m4a为扩展名的文件, 提供伪流媒体服务端支持。
二、nginx升级
1 备份原有文件
cp -a /usr/local/nginx /tmp/nginx_back
2 下载并解压nginx-1.14.1.tar.gz文件
wget http://nginx.org/download/nginx-1.14.1.tar.gz
tar -xf nginx-1.14.1
3 进入nginx-1.14.1目录
cd nginx-1.14.1
4 编译配置
(1)请先使用nginx -V 命令查看原有nginx编译的选项,
# nginx -V
nginx version: nginx/1.0.15
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-18) (GCC)
built with OpenSSL 1.0.1e-fips 11 Feb 2013
TLS SNI support enabled
configure arguments: --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module --with-http_flv_module --add-module=/usr/local/src/nginx-auth-ldap --with-http_realip_module
(2)故保持和原有一样的编译配置,根据自己情况具体而定。
./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module
--with-http_ssl_module --with-http_gzip_static_module --with-http_flv_module --with-http_realip_module
--with-http_auth_request_module --with-http_auth_request_module --add-module=/usr/local/src/nginx-auth-ldap
--add-module=/usr/local/src/headers-more-nginx-module-master --with-cc-opt=-Wno-error
5 编译
make
6 备份原来sbin/nginx
cd /usr/local/nginx/sbin/
mv nginx nginx.back
7 复制nginx-1.14.1/objs/nginx到/usr/local/nginx/sbin/
cp nginx-1.14.1/objs/nginx /usr/local/nginx/sbin/
8 升级
cd nginx-1.14.1 make upgrade
输出如下:
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful kill -USR2 `cat /usr/local/nginx/logs/nginx.pid` sleep 1 test -f /usr/local/nginx/logs/nginx.pid.oldbin kill -QUIT `cat /usr/local/nginx/logs/nginx.pid.oldbin`
或者输出为以下内容:
/usr/local/nginx/sbin/nginx -t nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful kill -USR2 `cat /usr/local/nginx/logs/nginx.pid` sleep 1 test -f /usr/local/nginx/logs/nginx.pid.oldbin make: *** [upgrade] Error 1
看到 Error 1也不用太在意,已经升级成功
如果nginx是关闭的请情况输出如下:
/usr/local/nginx/sbin/nginx -t nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful kill -USR2 `cat /usr/local/nginx/logs/nginx.pid` kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec] make: *** [upgrade] Error 1
9 查看升级是否成功
# /usr/local/nginx/sbin/nginx -v
nginx version: nginx/1.14.1
如果想隐藏版本号,可参考 https://www.cnblogs.com/Sunzz/p/9962891.html
推荐阅读
-
简易攻略:如何应对与修复Nginx常出现的漏洞问题
-
如何修补 Nginx 的解析漏洞 - 可行的修复方案与建议
-
剖析与更新修复Nginx漏洞的方法
-
检测与修复:针对Apache和Nginx的网站渗透测试中发现的上传文件解析漏洞
-
更新!针对 nginx 1.12.2 的安全漏洞修复说明
-
如何修复Nginx中的HTTP Host头攻击漏洞:检测与解决方法
-
深度学习中的不确定性量化:2020年实用技术与应用大解析 - 61页精华解读" 这份报告深入剖析了近年来深度学习领域中不确定性量化(UQ)技术的最新发展,包括其在强化学习(RL)中的运用实例。探讨了贝叶斯近似和集成学习等主流UQ方法在各个具体场景中的广泛应用,比如自动驾驶、目标识别、图像修复、医疗影像分析(如分类和分割)、文本理解(如文本分类和风险评估)、以及生物信息学等多个领域。 报告进一步梳理了UQ方法在深度学习领域的关键应用案例,并针对当前面临的挑战及未来研究方向进行了概览和展望,为这一领域的研究人员和实践者提供了有价值的参考指南。
-
理解与剖析常见的文件包含漏洞及其利用方法
-
新研究被IEEE S&P采纳:结合程序剖析与Fuzz技术的Java反序列化安全漏洞探索方法