갑자기 리눅스 서버 보안 패치가 올라왔길래 뭔가 했더니
sudo 1.9.5p2 이하 버전에는 heap-base buffer overflow가 발생할 수 있다고 한다
cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-3156
CVE - CVE-2021-3156
20210115 Disclaimer: The record creation date may reflect when the CVE ID was allocated or reserved, and does not necessarily indicate when this vulnerability was discovered, shared with the affected vendor, publicly disclosed, or updated in CVE.
cve.mitre.org
Sudo before 1.9.5p2 has a Heap-based Buffer Overflow, allowing privilege escalation to root via "sudoedit -s" and a command-line argument that ends with a single backslash character.
버전 업그레이드가 필요한지 확인하는 방법은 아래 명령어를 쳐본다
$ sudoedit -s /
만약 아래처럼 sudoedit이 /에 접근할 수 있는 것 처럼 나오면 보안 패치를 적용해야 한다.
sudoedit: /: not a regular file
만약 아래처럼 usage가 나오면 이미 보안 패치가 적용 된 것.
usage: sudoedit [-AknS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p
prompt] [-T timeout] [-u user] file ...
해결 방법은 ubuntu 버전마다 다른건지 apt-get update가 안먹은건지.. 모르겠지만
ubuntu 18.04와 14.04일 때 다르게 적용했다
1) ubuntu 18.04 일 때
아래 changelog로 sudo patch 중 CVE-2021-3156 대응 patch가 있는지 확인한다
sudo apt update ; apt changelog sudo | grep CVE-2021-3156
sudo만 upgrade한다
sudo apt update; sudo apt --only-upgrade install sudo
2) ubuntu 14.04일 때
위 명령어로 CVE가 안보여서ㅠㅠ 그냥 파일 다운로드 해서 로컬 빌드로 적용함
sudo apt install make gcc && wget https://www.sudo.ws/dist/sudo-1.9.5p2.tar.gz && tar -xf sudo-1.9.5p2.tar.gz && cd sudo-1.9.5p2 && ./configure --prefix=/usr && make && sudo make install
이 글을 참고했다 : www.xmodulo.com/update-sudo-version-linux.html
How to update sudo version on Linux
How to update sudo version on Linux Last updated on February 6, 2021 by Dan Nanni Question: I learned about a serious security vulnerability discovered in the sudo command, and I want to upgrade sudo to the latest version immediately to fix its vulnerabili
www.xmodulo.com
'개발 > 리눅스 서버' 카테고리의 다른 글
프로세스 관리하기 - 1) ps (0) | 2021.03.11 |
---|---|
gerrit + Apache2 설치 및 설정 (0) | 2020.02.03 |
parse json with default bash only (0) | 2020.01.29 |
linux 명령어 모음집 (0) | 2020.01.22 |
100G 넘는 파일을 어떻게 복사할까? - rsync (0) | 2020.01.21 |
댓글