** 설명
- CVE-2022-0847용 POC: Linux Kernel 로컬 권한 상승 취약점.
- 2022-03-08에 antx가 작성함.
** 세부 정보
- 보안 연구원 Max Kellermann은 'Dirty Pipe' 취약점을 책임 있게 공개했으며, Android 기기를 포함한 Linux Kernel 5.8 이상 버전에 영향을 미친다고 밝혔습니다.
- 5.8부터 존재하는 Linux 커널 취약점으로, 임의의 읽기 전용 파일에 데이터를 덮어쓸 수 있습니다. 권한이 없는 프로세스가 루트 프로세스에 코드를 주입할 수 있으므로 권한 상승으로 이어집니다.
- Linux 커널의 copy_page_to_iter_pipe 및 push_pipe 함수에서 새 파이프 버퍼 구조체의 "flags" 멤버가 제대로 초기화되지 않아 오래된(stale) 값을 포함할 수 있다는 결함이 발견되었습니다. 권한이 없는 로컬 사용자는 이 결함을 이용하여 읽기 전용 파일이 뒷받침하는 페이지 캐시의 페이지에 쓸 수 있으며, 이를 통해 시스템에서 권한을 상승시킬 수 있습니다. 이 결함은 5.17-rc6 이전의 Linux 커널 버전에 영향을 미칩니다.
- [[https://nvd.nist.gov/vuln/detail/CVE-2016-5195][CVE-2016-5195]] "Dirty Cow"와 유사하지만 악용하기 더 쉽습니다.
- 이 취약점은 Linux 5.16.11, 5.15.25 및 5.10.102에서 [[https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=9d2231c5d74e13b2a0546fee6737ee4446017903][수정]]되었습니다.
** CVE 심각도
- attackComplexity: LOW
- attackVector: LOCAL
- availabilityImpact: -
- confidentialityImpact: -
- integrityImpact: HIGH
- privilegesRequired: -
- scope: -
- userInteraction: -
- version: 3.1
- baseScore: -
- baseSeverity: -
** 영향
- Linux Kernel 5.8 이상 버전, Android 기기 포함.
** POC
- [[./CVE-2022-0847.c][Poc]]
** 참고
- Ref-Source
- [[https://dirtypipe.cm4all.com/][Dirty Pipe 취약점]]
- [[https://github.com/Arinerron/CVE-2022-0847-DirtyPipe-Exploit][CVE-2022-0847-DirtyPipe-Exploit]]
- Ref-Article
- [[https://www.bleepingcomputer.com/news/security/new-linux-bug-gives-root-on-all-major-distros-exploit-released/][new-linux-bug-gives-root-on-all-major-distros-exploit-released]]
- Ref-Poc
- [[https://github.com/Al1ex/LinuxEelvation/tree/master/CVE-2022-0847][CVE-2022-0847]]
- [[https://github.com/imfiver/CVE-2022-0847][CVE-2022-0847]]
- [[https://github.com/lucksec/CVE-2022-0847][CVE-2022-0847]]
- [[https://github.com/bbaranoff/CVE-2022-0847][CVE-2022-0847]]
- Ref-Risk
- CVE
- Ref-Related
- [[https://nvd.nist.gov/vuln/detail/CVE-2016-5195][CVE-2016-5195]]