❤️ AZDIGI chính thức cập nhật hệ thống blog mới hoàn chỉnh. Tuy nhiên có thể một số bài viết bị sai lệch hình ảnh, hãy ấn nút Báo cáo bài viết ở cuối bài để AZDIGI cập nhật trong thời gian nhanh nhất. Chân thành cám ơn.

Lỗ hổng regreSSHion là gì?

Lỗ hổng regreSSHion trong OpenSSH có mã là CVE-2024-6387, là một lỗ hổng bảo mật nghiêm trọng ảnh hưởng đến máy chủ OpenSSH.

Dưới đây là một số điểm quan trọng về lỗi này:

  1. Vulnerability (Lỗ hổng): Đây là một lỗ hổng Remote Unauthenticated Code Execution (RCE) trong máy chủ OpenSSH (sshd) trên các hệ thống Linux dựa trên glibc. Nó cho phép kẻ tấn công thực thi mã nguồn từ xa mà không cần xác thực, và nếu bị khai thác, có thể dẫn đến quyền truy cập root.
  2. Phạm vi ảnh hưởng: Lỗ hổng này ảnh hưởng đến các phiên bản OpenSSH từ 8.5p1 đến 9.7p1.
  3. Chi tiết kỹ thuật: Lỗ hổng này xuất phát từ một điều kiện race condition trong xử lý tín hiệu của OpenSSH. Nó là một sự regression của một lỗ hổng cũ hơn (CVE-2006-5051), đã được vá lại vào năm 2006. Kẻ tấn công có thể thực thi mã nguồn tùy ý với quyền root.
  4. Khuyến nghị: Nếu bạn đang chạy máy chủ OpenSSH trên phiên bản bị ảnh hưởng, bạn nên cập nhật ngay lập tức.

Các hệ điều hành bị ảnh hưởng

  1. Ubuntu phiên bản 22.04 (jammy) trở lên – Ubuntu Security Notice
  2. Red Hat Enterprise Linux 9 – Red Hat Security Notice (Red Hat Enterprise Linux 6, 7, và 8 sử dụng phiên bản OpenSSH cũ không bị ảnh hưởng)
    1. AlmaLinux OS 9
    2. Rocky Linux 9
  3. Debian 12 (bookworm) – Debian Security Notice
  4. Fedora – Fedora packages
  5. SUSE – SUSE Security Notice
  6. AWS Linux – Amazon Linux Security Center

Cách cập nhật phiên bản OpenSSH để bảo vệ máy chủ

Hệ điều hành Ubuntu:

Phiên bản Ubuntu 22.04 (jammy): Đảm bảo OpenSSH được cập nhật lên phiên bản OpenSSH_8.9p1 Ubuntu-3ubuntu0.10 trở lên.

Kiểm tra phiên bản ssh hiện tại.

AZDIGI Tutorial
ssh -V
OpenSSH_8.9p1 Ubuntu-3ubuntu0.7, OpenSSL 3.0.2 15 Mar 2022
    

Chạy lệnh bên dưới chỉ cập nhật phiên bản SSH.

AZDIGI Tutorial
apt update -y
apt-get install --only-upgrade openssh-server -y
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following package was automatically installed and is no longer required:
  vim-runtime
Use 'apt autoremove' to remove it.
The following additional packages will be installed:
  openssh-client openssh-sftp-server
Suggested packages:
  keychain libpam-ssh monkeysphere ssh-askpass molly-guard ufw
The following packages will be upgraded:
  openssh-client openssh-server openssh-sftp-server
3 upgraded, 0 newly installed, 0 to remove and 22 not upgraded.
Need to get 1,379 kB of archives.
After this operation, 4,096 B disk space will be freed.
Get:1 http://mirror.viettelcloud.vn/ubuntu jammy-updates/main amd64 openssh-sftp-server amd64 1:8.9p1-3ubuntu0.10 [38.9 kB]
Get:2 http://mirror.viettelcloud.vn/ubuntu jammy-updates/main amd64 openssh-server amd64 1:8.9p1-3ubuntu0.10 [435 kB]
Get:3 http://mirror.viettelcloud.vn/ubuntu jammy-updates/main amd64 openssh-client amd64 1:8.9p1-3ubuntu0.10 [906 kB]
Fetched 1,379 kB in 0s (7,918 kB/s)
Preconfiguring packages ...
(Reading database ... 144191 files and directories currently installed.)
Preparing to unpack .../openssh-sftp-server_1%3a8.9p1-3ubuntu0.10_amd64.deb ...
Unpacking openssh-sftp-server (1:8.9p1-3ubuntu0.10) over (1:8.9p1-3ubuntu0.7) ...
Preparing to unpack .../openssh-server_1%3a8.9p1-3ubuntu0.10_amd64.deb ...
Unpacking openssh-server (1:8.9p1-3ubuntu0.10) over (1:8.9p1-3ubuntu0.7) ...
Preparing to unpack .../openssh-client_1%3a8.9p1-3ubuntu0.10_amd64.deb ...
Unpacking openssh-client (1:8.9p1-3ubuntu0.10) over (1:8.9p1-3ubuntu0.7) ...
Setting up openssh-client (1:8.9p1-3ubuntu0.10) ...
Setting up openssh-sftp-server (1:8.9p1-3ubuntu0.10) ...
Setting up openssh-server (1:8.9p1-3ubuntu0.10) ...
rescue-ssh.target is a disabled or a static unit not running, not starting it.
ssh.socket is a disabled or a static unit not running, not starting it.
Processing triggers for man-db (2.10.2-1) ...
Scanning processes...
Scanning candidates...
Scanning linux images...

Running kernel seems to be up-to-date.

No services need to be restarted.

No containers need to be restarted.

No user sessions are running outdated binaries.

No VM guests are running outdated hypervisor (qemu) binaries on this host.

Sau khi chạy lệnh update và cập nhật phiên bản SSH, kiểm tra lại phiên bản SSH.

Kết quả:

AZDIGI Tutorial
ssh -V
OpenSSH_8.9p1 Ubuntu-3ubuntu0.10, OpenSSL 3.0.2 15 Mar 2022
    

Phiên bản Ubuntu 24.04 (noble): Đảm bảo OpenSSH được cập nhật lên phiên bản OpenSSH_9.6p1 Ubuntu-3ubuntu13.3 trở lên.

Kiểm tra phiên bản ssh hiện tại.

AZDIGI Tutorial
ssh -V
OpenSSH_9.6p1 Ubuntu-3ubuntu13, OpenSSL 3.0.13 30 Jan 2024
    

Chạy lệnh bên dưới chỉ cập nhật phiên bản SSH.

AZDIGI Tutorial
apt update -y
apt-get install --only-upgrade openssh-server -y
    

Kết quả:

AZDIGI Tutorial
ssh -V
OpenSSH_9.6p1 Ubuntu-3ubuntu13.3, OpenSSL 3.0.13 30 Jan 2024
    

Hệ điều hành Almalinux OS 9

Đảm bảo OpenSSH được cập nhật lên phiên bản openssh-8.7p1-38.el9.alma.2 trở lên.

Nếu hệ điều hành Almalinux OS 9 mới vừa cài đặt bạn có thể chạy lênh dưới để update hệ điều hành, bao gồm cả phiên bản OpenSSH.

AZDIGI Tutorial
dnf update -y
    

Kết quả:

AZDIGI Tutorial
rpm -q openssh-server
openssh-server-8.7p1-38.el9.alma.2.x86_64
    

Hệ điều hành Rocky Linux 9

Đảm bảo OpenSSH được cập nhật lên phiên bản openssh-8.7p1-38.el9_4 trở lên.

Kiểm tra phiên bản ssh hiện tại.

AZDIGI Tutorial
rpm -q openssh-server
openssh-server-8.7p1-34.el9.x86_64
    

Link tham khảo tại đây:

Chạy lệnh bên dưới để cập nhật phiên bản SSH.

AZDIGI Tutorial
dnf install rocky-release-security -y
dnf config-manager --disable security-common
dnf --enablerepo=security-common update openssh*
    

Lưu ý: Trong quá trình cài đặt openssh, dịch vụ sẽ tự động khởi động lại.

Kết quả:

AZDIGI Tutorial
rpm -q openssh
openssh-8.7p1-38.el9_4.1.x86_64
    

Hệ điều hành Debian

Phiên bản Debian 12 (bookworm): Đảm bảo OpenSSH được cập nhật lên phiên bản OpenSSH_9.2p1 Debian-2+deb12u3 trở lên.

Kiểm tra phiên bản ssh hiện tại.

AZDIGI Tutorial
ssh -V
OpenSSH_9.2p1 Debian-2+deb12u2, OpenSSL 3.0.11 19 Sep 2023
    

Chạy lệnh bên dưới để cập nhật phiên bản SSH.

AZDIGI Tutorial
apt update -y
apt-get install --only-upgrade openssh-server -y
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  libssl3 openssh-client openssh-sftp-server openssl ssh
Suggested packages:
  keychain libpam-ssh monkeysphere ssh-askpass molly-guard ufw
The following packages will be upgraded:
  libssl3 openssh-client openssh-server openssh-sftp-server openssl ssh
6 upgraded, 0 newly installed, 0 to remove and 29 not upgraded.
Need to get 5,126 kB of archives.
After this operation, 1,024 B of additional disk space will be used.
Get:1 http://deb.debian.org/debian bookworm/main amd64 libssl3 amd64 3.0.13-1~deb12u1 [2,022 kB]
Get:2 http://security.debian.org/debian-security bookworm-security/main amd64 openssh-sftp-server amd64 1:9.2p1-2+deb12u3 [65.8 kB]
Get:3 http://security.debian.org/debian-security bookworm-security/main amd64 openssh-server amd64 1:9.2p1-2+deb12u3 [456 kB]
Get:4 http://security.debian.org/debian-security bookworm-security/main amd64 openssh-client amd64 1:9.2p1-2+deb12u3 [991 kB]
Get:5 http://security.debian.org/debian-security bookworm-security/main amd64 ssh all 1:9.2p1-2+deb12u3 [174 kB]
Get:6 http://deb.debian.org/debian bookworm/main amd64 openssl amd64 3.0.13-1~deb12u1 [1,418 kB]
Fetched 5,126 kB in 0s (15.4 MB/s)
apt-listchanges: Reading changelogs...
Preconfiguring packages ...
(Reading database ... 34060 files and directories currently installed.)
Preparing to unpack .../0-libssl3_3.0.13-1~deb12u1_amd64.deb ...
Unpacking libssl3:amd64 (3.0.13-1~deb12u1) over (3.0.11-1~deb12u2) ...
Preparing to unpack .../1-openssh-sftp-server_1%3a9.2p1-2+deb12u3_amd64.deb ...
Unpacking openssh-sftp-server (1:9.2p1-2+deb12u3) over (1:9.2p1-2+deb12u2) ...
Preparing to unpack .../2-openssh-server_1%3a9.2p1-2+deb12u3_amd64.deb ...
Unpacking openssh-server (1:9.2p1-2+deb12u3) over (1:9.2p1-2+deb12u2) ...
Preparing to unpack .../3-openssh-client_1%3a9.2p1-2+deb12u3_amd64.deb ...
Unpacking openssh-client (1:9.2p1-2+deb12u3) over (1:9.2p1-2+deb12u2) ...
Preparing to unpack .../4-openssl_3.0.13-1~deb12u1_amd64.deb ...
Unpacking openssl (3.0.13-1~deb12u1) over (3.0.11-1~deb12u2) ...
Preparing to unpack .../5-ssh_1%3a9.2p1-2+deb12u3_all.deb ...
Unpacking ssh (1:9.2p1-2+deb12u3) over (1:9.2p1-2+deb12u2) ...
Setting up libssl3:amd64 (3.0.13-1~deb12u1) ...
Setting up openssl (3.0.13-1~deb12u1) ...
Setting up openssh-client (1:9.2p1-2+deb12u3) ...
Setting up openssh-sftp-server (1:9.2p1-2+deb12u3) ...
Setting up openssh-server (1:9.2p1-2+deb12u3) ...
Creating SSH2 ECDSA key; this may take some time ...
256 SHA256:iG5DB87DB7MSlbYXqL1F914HfKndShdtq0ih1sVgQRs root@testaapanel (ECDSA)
Creating SSH2 ED25519 key; this may take some time ...
256 SHA256:xARV4j/jUfgWy2tI65y+5/GBgdrLX1cUVtb8H7OHBNQ root@testaapanel (ED25519)
rescue-ssh.target is a disabled or a static unit not running, not starting it.
ssh.socket is a disabled or a static unit not running, not starting it.
Setting up ssh (1:9.2p1-2+deb12u3) ...
Processing triggers for man-db (2.11.2-2) ...
Processing triggers for libc-bin (2.36-9+deb12u7) ...
    

Kết quả:

AZDIGI Tutorial
ssh -V
OpenSSH_9.2p1 Debian-2+deb12u3, OpenSSL 3.0.13 30 Jan 2024
    

Nếu bạn đang chạy máy chủ OpenSSH trên phiên bản bị ảnh hưởng, hãy cập nhật ngay lập tức để khắc phục lỗ hổng này.

Hy vọng bạn tìm thấy thông tin hữu ích trong bài viết này.

Nếu các bạn cần hỗ trợ các bạn có thể liên hệ bộ phận hỗ trợ theo các cách bên dưới:

Chia sẻ:
Bài viết đã được kiểm duyệt bởi AZDIGI Team

Về tác giả

Thạch Phạm

Thạch Phạm

Đồng sáng lập và Giám đốc điều hành của AZDIGI. Có hơn 15 năm kinh nghiệm trong phổ biến kiến thức liên quan đến WordPress tại thachpham.com, phát triển website và phát triển hệ thống.

Hơn 10 năm phục vụ 80.000+ khách hàng

Bắt đầu dự án web của bạn với AZDIGI