악성코드

XZ Utils (CVE-2024-3094) 백도어 확인 방법과 시사점

쿨캣7 2024. 4. 12. 05:15
728x90
반응형

 

한국 시간 3월 31일 일요일에 XZ Utils 5.6.0과 5.6.1에 백도어가 포함되었다는 뉴스가 알려졌습니다.

 

. Urgent: Secret Backdoor Found in XZ Utils Library, Impacts Major Linux Distros (The Hacker News, 2024.03.30)

https://thehackernews.com/2024/03/urgent-secret-backdoor-found-in-xz.html

 

 

처음에는 흔한(?) 취약점인가했는데 몇 가지 흥미로운 부분이 있습니다.

 

관련 프로젝트는 'The Tukaani Project'  입니다.

 

 

 

 

관련 취약점은 3월 29일 금요일에 공개되었습니다.

 

https://nvd.nist.gov/vuln/detail/CVE-2024-3094

 

NVD - CVE-2024-3094

CVE-2024-3094 Detail Modified This vulnerability has been modified since it was last analyzed by the NVD. It is awaiting reanalysis which may result in further changes to the information provided. Description Malicious code was discovered in the upstream t

nvd.nist.gov

 

. CVE-2024-3094

 

https://access.redhat.com/security/cve/CVE-2024-3094

 

cve-details

Infrastructure and Management Cloud Computing Storage Runtimes Integration and Automation

access.redhat.com

 

 

https://www.helpnetsecurity.com/2024/03/31/xz-backdoored-linux-affected-distros/

 

XZ Utils backdoor update: Which Linux distros are affected and what can you do? - Help Net Security

The news that XZ Utils, a utility present in most Linux distributions, has been backdoored has rattled the open-source software community.

www.helpnetsecurity.com

 

 

https://gist.github.com/thesamesam/223949d5a074ebc3dce9ee78baad9e27

 

xz-utils backdoor situation (CVE-2024-3094)

xz-utils backdoor situation (CVE-2024-3094). GitHub Gist: instantly share code, notes, and snippets.

gist.github.com

 

 

 

 

* 발견 과정

 

마이크로소프트에 근무하는 Andres Freund 씨가 발견했습니다.

 

 

https://mastodon.social/@AndresFreundTec/112180406142695845

 

AndresFreundTec (@AndresFreundTec@mastodon.social)

I was doing some micro-benchmarking at the time, needed to quiesce the system to reduce noise. Saw sshd processes were using a surprising amount of CPU, despite immediately failing because of wrong usernames etc. Profiled sshd, showing lots of cpu time in

mastodon.social

 

 

 

확인결과 Jia Tan(JiaT75) 사용자가 문제의 코드를 커밋했습니다.

만약 취약점을 발견하지 못했다만 백도어 기능이 포함된 리눅스 배포판을 모르고 사용하고 있을 수 있습니다.

 

 

* 취약점

 

 

CVE-2024-3094에 의해 도입된 악성 백도어의 최종 목표는 피해자 컴퓨터에서 실행되는 OpenSSH 서버(SSHD)에 코드를 삽입하고 특정 원격 공격자(특정 개인 키를 소유한)가 임의의 메시지를 보낼 수 있도록 허용한다고 한다.

 

 

 

 

* 영향을 받는 제품과 버전들

 

2월 24일 출시된 XZ Utils 버전 5.6.0과 3월 9일 출시된 및 5.6.1이 영향을 받는다고 합니다.

 

 

.  Arch Linux (설치 매체 2024.03.01, 가상 머신 이미지 20240301.218094 및 20240315.221711, 2024-02-24 및 2024-03-28 사이에 생성된 컨테이너 이미지)

.  Kali Linux (3월 26일~29일)


.  openSUSE Tumbleweed 및 openSUSE MicroOS (3월 7일~28일)


.   Debian 테스트, 불안정 및 실험 버전 (5.5.1alpha-0.1에서 5.6.1-1까지)

 

 

Alpine Linux, Amazon Linux, Debian Stable, Gentoo Linux, Linux Mint, Red Hat Enterprise Linux (RHEL), SUSE Linux Enterprise, Leap, Ubuntu 배포판에는 영향을 받지 않는다고 합니다.

 

 

* 취약점 확인법

 

xz --version 명령으로 liblzma 파일의 버전으로 확인할 수 있습니다.

 

3월 25일 업데이트한 칼리 리눅스 버전은 5.4.5 로 정상입니다.

 

3월 28일에 업데이트된 파일은 취약점을 가지고 있는 5.6.0 버전으로 취약합니다.

 

4월 2일 업데이트 후에 다시 liblzma 가 5.4.5가 되었습니다.

 

 

 

간단한 탐지 프로그램이 등장했습니다.

 

 

https://xz.fail/

 

Binarly XZ backdoor detector

Status: The analysis result (malicious, benign, etc.) Details: MD5, SHA-1, SHA-256, SHA-512: hashes of the input binaryAnalysis time: time taken to complete the analysisSuspicious IFUNC resolvers: list of suspicious IFUNC resolversPotential triggers: list

xz.fail

 

 


. New XZ backdoor scanner detects implant in any Linux binary (BleepingComputer, 2024.04.02)
https://www.bleepingcomputer.com/news/security/new-xz-backdoor-scanner-detects-implant-in-any-linux-binary/

 

New XZ backdoor scanner detects implant in any Linux binary

Firmware security firm Binarly has released a free online scanner to detect Linux executables impacted by the XZ Utils supply chain attack, tracked as CVE-2024-3094.

www.bleepingcomputer.com

 

 

 

* 신뢰를 쌓고 준비

 

이번 공격에 흥미로운 점은 악의적인 코드를 커밋한 사람은 3년 이상 신뢰를 쌓았다는 점입니다.

 

2021년에 가입해 관련 프로젝트에 열심히 활동했고 신뢰를 쌓은 후에 악의적인 코드를 몰래 숨겨두었습니다.


. XZ Utils 백도어 악성코드, 2021년부터 공들여 준비해온 공급망 공격이었다 (보안뉴스, 2024.04.01)
https://www.boannews.com/media/view.asp?idx=128372

 

 

타임라인이 잘 정리된 블로그입니다.

 

. Everything I Know About the XZ Backdoor (Evan Boehs 블로그)
https://boehs.org/node/everything-i-know-about-the-xz-backdoor

 

 

 

https://twitter.com/fr0gger_/status/1774342248437813525

 

X의 Thomas Roccia 🤘님(@fr0gger_)

🤯 The level of sophistication of the XZ attack is very impressive! I tried to make sense of the analysis in a single page (which was quite complicated)! I hope it helps to make sense of the information out there. Please treat the information "as is" whi

twitter.com

Jia Tan은 동유럽 시간대에서 활동했다고 합니다.

 

. The Mystery of ‘Jia Tan,’ the XZ Backdoor Mastermind (Wired, 2024.04.03)
https://www.wired.com/story/jia-tan-xz-backdoor/

 

The Mystery of ‘Jia Tan,’ the XZ Backdoor Mastermind

The thwarted XZ Utils supply chain attack was years in the making. Now, clues suggest nation-state hackers were behind the persona that inserted the malicious code.

www.wired.com

 

 

* 시사점

 

이번 사건은 취약점, 공급망 공격 관점에서 매우 흥미롭습니다.

 

Jia Tan은 누구일까요 ?

Jia Tan은 처음부터 백도어를 심으려고 마음먹고 가입했을까요 ? 아니면 Jia Tan 계정이 해킹 당했을까요 ?

만약 해킹을 당했다면 'Jia Tan'은 자신의 억울함을 얘기했을 수도 있는데 아직 그런 내용은 확인하지 못했습니다.

 

공격자가 처음부터 악의적 행위를 하기로 마음먹고 3년이란 시간을 신뢰 쌓으면서 기다렸다고 볼 수 있습니다.

 

.XZ유틸즈에서 발견된 백도어, 오픈소스 커뮤니티를 침체시켜 (보안뉴스, 2024-04-02)
https://www.boannews.com/media/view.asp?idx=128442

 

오픈소스 커뮤니티도 신뢰 할 수 있는 사람이라도 커밋하는 코드 리뷰를 좀 더 철저하게 해야겠습니다.

 

 

 

 

 

 

 

 

 

728x90
반응형