취약점 유형 | Privilege Escalation |
CVSS 점수 | 7.8 (HIGH) |
취약점 공개 날짜 | 2021-04-15 |
Linux Kernel의 overlayfs 파일시스템 구현에 있어서 user namespace와 관련한 파일시스템 capability 적용에 대해 적절히 검증하지 않았다. Ubuntu의 로컬 공격자는 해당 취약점을 사용해서 Ubuntu의 권한없는 overlayfs 마운트의 허가로 권한 상승으로 이어질 수 있다.
linux에서 파일에 대해 file capability를 적용하는 과정은 다음과 같다.
setxattr(...):
if cap_convert_nscap(...) is not OK:
then fail
vfs_setxattr(...)
cap_convert_nscap을 통해 네임스페이스에 대한 권한이 있는지 체크한 후 파일에 capability를 세팅한다.
하지만 Overlayfs에서 파일 시스템에 대해 file capability를 적용할 때, vfs_setxattr() 함수만 호출하고 cap_convert_nscap()을 호출 하지 않아 네임스페이스에 대한 권한 체크가 부재하다.
이것은 해당 파일들에 대해 외부 네임스페이스나 마운트를 할 수 있도록 capability를 설정할 수 있도록 한다.
briskets/CVE-2021-3493
Ubuntu OverlayFS Local Privesc. Contribute to briskets/CVE-2021-3493 development by creating an account on GitHub.
github.com
sudo apt-get update
sudo apt install linux-image-5.6.0-1055-oem
sudo reboot
취약한 커널 버전에 영향을 받는 우분투를 사용하고 있으면, 위의 과정으로 커널 버전 업을 한다.
vfs: move cap_convert_nscap() call into vfs_setxattr() · torvalds/linux@7c03e2c
vfs: move cap_convert_nscap() call into vfs_setxattr() · torvalds/linux@7c03e2c
cap_convert_nscap() does permission checking as well as conversion of the xattr value conditionally based on fs's user-ns. This is needed by overlayfs and probably other layered fs (ecryptfs) ...
github.com
Linux Kernel v5.11에서 패치되었다.
cap_convert_nscap 호출을 vfs_setxattr() 함수에 추가해서 취약점을 패치했다.
CVE - CVE-2021-3493
20210412 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
SSD Advisory - OverlayFS PE - SSD Secure Disclosure
SSD Advisory – OverlayFS PE - SSD Secure Disclosure
TL;DR Find out how a vulnerability in OverlayFS allows local users under Ubuntu to gain root privileges. Vulnerability Summary An Ubuntu specific issue […]
ssd-disclosure.com
[1day Analysis] CVE-2022-37958 취약점 분석 (0) | 2023.07.25 |
---|---|
CVE-2021-3156 : Privilege Escalation by Sudo Vulnerability (0) | 2021.09.11 |
CVE-2020-15257 : Docker host escape vulnerability using host networking (0) | 2021.06.30 |
CVE-2017-5123 Analysis - Linux Kernel Vulnerability(Privilege Escalation) (0) | 2021.05.09 |