CVE-2024-3094 Reported Supply Chain Compromise Affecting XZ Utils Data Compression Library

Severity: Critical 

CVSSv3 Score: 10.0 

Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H 

Mô tả: 

xz (XZ Utils) là phần mềm nén dữ liệu được cài đặt phổ biến trong các bản phân phối Linux. 

Ngày 29/03/2024, một developer đã phát hiện ra một mã độc (backdoor) tồn tại trong thư viện liblzma của gói phần mềm này và lỗ hổng sau đó được định danh CVE-2024-3094 với mức độ rất nghiêm trọng. 

Kết quả điều tra cho thấy ngày 23 tháng 2 năm 2024, kẻ tấn công đã gửi commit mã độc lên Github repository của XZ Utils. Đoạn mã này được viết với kỹ thuật xáo trộn (obfuscated code) khiến việc phát hiện trở nên khó khăn và đã làm thay đổi quy trình biên dịch của thư viện libzma. 

Một hậu quả nguy hiểm dễ thấy nhất nếu lỗ hổng được khai thác thành công là hacker có thể lợi dụng để can thiệp và bypass luồng xác thực của SSHD sau đó giành quyền truy cập vào toàn bộ hệ thống. Điều này có thể xảy ra bởi các bản phân phối Linux thường đã bao gồm sẵn phiên bản đã biên dịch của thư viện liblzma mà công cụ SSH sử dụng. 

Phiên bản bị ảnh hưởng: 

xz/liblzma versions: 5.6.0 và 5.6.1 

Chi tiết các bản phân phối Linux và phiên bản package bị ảnh hưởng bởi CVE-2024-3094 được tổng hợp: 

Distro Notes Package Affected versions Fixed versions 
RedHat Red Hat Enterprise Linux (RHEL) is not affected, but Fedora 41 and Fedora Rawhide are affected. xz Fedora 41 and Fedora Rawhide RedHat has advised users to immediately stop any instances of Fedora 41 or Fedora Rawhide. 
Debian No Debian stable versions are known to be affected, but non-stable branches are affected. xz-utils From 5.5.1alpha-0.1 up to and including 5.6.1-1 5.6.1+really5.4.5-1 
Kali Linux Affects Kali installations updated between March 26th to March 29th. xz-utils 5.6.0-0.2 Upgrade to the latest version 
OpenSUSE openSUSE maintainers have rolled back the version of xz on Tumbleweed on March 28th and have released a new Tumbleweed snapshot (20240328 or later) that was built from a safe backup. xz 5.6.0 5.6.1 5.6.1.revertto5.4 
Alpine xz 5.6.0 5.6.0-r0 5.6.0-r1 5.6.1 5.6.1-r0 5.6.1-r1 5.6.0-r2 5.6.1-r2 
Arch The following release artifacts contain the compromised package: (1) Installation medium 2024.03.01, (2) Virtual machine images 20240301.218094 and 20240315.221711, (3) Container images created between and including 2024-02-24 and 2024-03-28 xz 5.6.0-1 5.6.1-2 
Gentoo Gentoo recommends downgrading to an older version. xz-utils >= 5.6.0 < 5.6.0 
FreeBSD Not affected. 
Amazon Linux Not affected. 

Cách kiểm tra và khắc phục: 

Để xác định hệ thống có sử dụng thư viện xz đang tồn tại CVE-2024-3094 hay không, kiểm tra phiên bản đang sử dụng với lệnh: 

$ strings `which xz` | egrep '\(XZ Utils\)' 

$ strings `which xz` | grep '5\.6\.[01]' 

content.png
Thư viện xz sử dụng trên MacOS đang ở phiên bản 5.4.5 không bị ảnh hưởng bởi lỗ hổng 

Những admin của các hệ thống có sử dụng phiên bản thư viện xz 5.6.0 hoặc 5.6.1 cần nhanh chóng hạ cấp (downgrade) về xz Utils không chứa mã độc, ví dụ 5.4.6 stable. 

Tham khảo: 

  1. https://www.cisa.gov/news-events/alerts/2024/03/29/reported-supply-chain-compromise-affecting-xz-utils-data-compression-library-cve-2024-3094 
  2. https://sysdig.com/blog/cve-2024-3094-detecting-the-sshd-backdoor-in-xz-utils/ 
  3. https://arstechnica.com/security/2024/03/backdoor-found-in-widely-used-linux-utility-breaks-encrypted-ssh-connections/ 
  4. https://www.tenable.com/blog/frequently-asked-questions-cve-2024-3094-supply-chain-backdoor-in-xz-utils#:~:text=developer%20account%20compromised.-,What%20Linux%20distributions%20are%20affected%3F,-As%20of%20the 
  5. https://www.wiz.io/blog/cve-2024-3094-critical-rce-vulnerability-found-in-xz-utils