今天接到通知,服务器上的openssl版本太低,会有CVE-2021-3449 CVE-2021-3450 两个高危漏洞,官方已在OpenSSL 1.1.1k 版中修复了这两个漏洞。

OpenSSL 是一个常用的软件库,用于构建需要建立安全通信的网络应用和服务器。当前,OpenSSL 项目针对潜伏在 OpenSSL 产品中的两个高危漏洞 CVE-2021-3449 和 CVE-2021-3450 发布了公告说明,具体如下。

这两个漏洞包括:

CVE-2021-3449:由于 NULL 指针取消引用而导致的拒绝服务(DoS)漏洞,只影响 OpenSSL 服务器实例,而不影响客户端。

CVE-2021-3450:不正确的 CA 证书验证漏洞,同时影响服务器和客户端实例。

查看当前版本

1
2
3
openssl version

OpenSSL 1.0.2k-fips 26 Jan 2017

升级到最新版本

下载OpenSSL-1.1.1k

1
wget https://www.openssl.org/source/openssl-1.1.1k.tar.gz

可以通过OpenSSL - Downloads下载。

编译安装

解压

1
tar -zxvf openssl-1.1.1k.tar.gz 

编译

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
cd openssl-1.1.1k/

#如果此步骤报错,需要安装perl以及gcc包
./config --prefix=/usr/local/openssl

Operating system: x86_64-whatever-linux2
Configuring OpenSSL version 1.1.1k (0x101010bfL) for linux-x86_64
Using os-specific seed configuration
Creating configdata.pm
Creating Makefile

**********************************************************************
*** ***
*** OpenSSL has been successfully configured ***
*** ***
*** If you encounter a problem while building, please open an ***
*** issue on GitHub <https://github.com/openssl/openssl/issues> ***
*** and include the output from the following command: ***
*** ***
*** perl configdata.pm --dump ***
*** ***
*** (If you are new to OpenSSL, you might want to consult the ***
*** 'Troubleshooting' section in the INSTALL file first) ***
*** ***
**********************************************************************
1
2
3
make && make install
# 如果编译有问题,需要安装Development tools
yum groupinstall Development tools

安装

1
2
3
4
mv /usr/bin/openssl /usr/bin/openssl.bak
ln -sf /usr/local/openssl/bin/openssl /usr/bin/openssl
echo "/usr/local/openssl/lib" >> /etc/ld.so.conf
ldconfig -v # 设置生效

再次查看版本

1
2
3
openssl version

OpenSSL 1.1.1k 25 Mar 2021