Lỗ hổng bảo mật CVE-2026-41940 vừa được cPanel công bố vào ngày 30/04/2026 đã nhanh chóng trở thành một trong những mối đe dọa nghiêm trọng nhất đối với hệ thống hosting hiện nay. Lỗ hổng này ảnh hưởng đến cPanel & WHM cũng như WP Squared (WP2), đặc biệt là các phiên bản từ 11.40 trở về sau.

Theo thông báo chính thức, nguyên nhân của lỗ hổng xuất phát từ một vấn đề bảo mật liên quan đến việc bỏ qua xác thực, được phát hiện trong phần mềm cPanel (bao gồm cả DNSOnly), ảnh hưởng đến tất cả các phiên bản sau 11.40. Điều này cho phép kẻ tấn công từ xa, không cần xác thực, có thể truy cập trái phép vào hệ thống quản trị.
CVE-2026-41940 được đánh giá có mức độ nghiêm trọng cao do khả năng khai thác dễ dàng và không yêu cầu tương tác từ người dùng. Lỗ hổng này cho phép attacker tấn công hệ thống cPanel thông qua các port 2083 (cPanel), 2087 (WHM), 2095 (webmail non-SSL) và 2096 (webmail SSL).
Lỗ hổng này ảnh hưởng đến hầu hết các phiên bản cPanel đang được hỗ trợ. Nếu bị khai thác thành công, attacker có thể chiếm quyền truy cập vào control panel, từ đó kiểm soát toàn bộ hệ thống bao gồm website, database và cấu hình server. Điều này có thể dẫn đến rò rỉ dữ liệu, thay đổi nội dung website hoặc sử dụng server cho các mục đích tấn công khác.
Để xử lý vấn đề, cPanel đã phát hành các bản vá cho nhiều phiên bản, bao gồm:
- 11.110.0.97
- 11.118.0.63
- 11.126.0.54
- 11.130.0.18
- 11.132.0.29
- 11.134.0.20
- 11.136.0.5
Ngoài ra, WP Squared cũng được vá ở phiên bản 136.1.7.
Đối với khách hàng vẫn đang sử dụng CentOS 6 hoặc CloudLinux 6 phiên bản v110.0.50, cPanel cũng đã phát hành phiên bản v110.0.103 như một bản cập nhật trực tiếp. Để nâng cấp lên phiên bản này, hãy chạy lệnh sau để thiết lập cấp độ nâng cấp, sau đó làm theo các bước trong phần “Các thao tác cần thiết” bên dưới.
# whmapi1 set_tier tier=11.110.0.103
Các quản trị viên được yêu cầu cập nhật ngay lập tức bằng lệnh:
- Hãy cập nhật máy chủ lên một trong các phiên bản được liệt kê ở trên ngay lập tức thông qua tập lệnh cập nhật cPanel.
# /scripts/upcp –force
- Sau khi quá trình cập nhật hoàn tất, hãy kiểm tra và xác nhận phiên bản build cPanel được trả về, sau đó khởi động lại dịch vụ cPanel (cpsrvd):
# /usr/local/cpanel/cpanel -V
# /scripts/restartsrv_cpsrvd
- Vui lòng lưu ý rằng nếu bạn đã tắt cập nhật cPanel hoặc ghim cấu hình cập nhật cPanel của mình vào một phiên bản cụ thể, thì các máy chủ này sẽ không tự động cập nhật. Vui lòng xác định và cập nhật các máy chủ này theo cách thủ công càng sớm càng tốt. Nếu máy chủ sử dụng CentOS 7 hoặc CloudLinux 7, bạn cần đặt phiên bản thành 11.110.
# whmapi1 set_tier tier=11.110
Thông tin về cách tùy chỉnh cài đặt Cập nhật của cPanel từ dòng lệnh có thể được tìm thấy trong bài viết hỗ trợ sau:
How to customize cPanel’s Update Preferences from the Command Line – cPanel
Một lưu ý quan trọng là những hệ thống đã tắt auto-update hoặc “pin” phiên bản sẽ không tự động nhận bản vá, do đó cần được cập nhật thủ công càng sớm càng tốt.
Ngoài việc cập nhật, trong trường hợp chưa thể vá ngay, các biện pháp giảm thiểu tạm thời có thể được áp dụng như chặn truy cập đến các cổng (2083, 2087, 2095, 2096) hoặc hạn chế truy cập từ bên ngoài. Tuy nhiên, đây chỉ là giải pháp ngắn hạn.
cPanel cũng cung cấp thêm script kiểm tra để phát hiện dấu hiệu bị khai thác, tập trung vào việc phân tích session trong hệ thống. Nếu phát hiện bất thường, quản trị viên nên xóa session, đổi mật khẩu và kiểm tra log hệ thống để đảm bảo không còn backdoor hoặc truy cập trái phép.
Detection Script
cPanel cũng cung cấp đoạn mã phát hiện sau đây để tìm kiếm các dấu hiệu xâm phạm và kiểm tra các phiên trong hệ thống tập tin.
Lưu nội dung sau dưới dạng: ioc_checksessions_files.sh
| #!/bin/bash
# Scan for compromised session files SESSIONS_DIR=”/var/cpanel/sessions” COMPROMISED=0 echo “[*] Scanning session files for injection indicators…” for session_file in “$SESSIONS_DIR”/raw/*; do [ -f “$session_file” ] || continue session_name=$(basename “$session_file”) # Check if this session is/was pre-auth preauth_file=”$SESSIONS_DIR/preauth/$session_name” # IOC 0: Session has both token_denied AND cp_security_token and method=badpass origin (strong indicator of exploitation) # # token_denied is set by do_token_denied() in cpsrvd when a request # supplies an incorrect security token. cp_security_token is the # attacker-injected token value. This combination indicates: # # 1. Attacker injected a cp_security_token via newline payload # 2. Attacker attempted to use the injected token # 3. cpsrvd recorded the token mismatch (token_denied counter) # during the exploitation window before the session was # fully promoted # # In a legitimate session: # – token_denied is only present after a user-initiated # security token failure (rare, typically from expired bookmarks) # – It would never co-exist with a badpass origin AND an # attacker-controlled cp_security_token # # This IOC catches BOTH successful and failed exploitation attempts. if grep -q ‘^token_denied=’ “$session_file” && \ grep -q ‘^cp_security_token=’ “$session_file”; then # Extract values for triage context token_val=$(grep ‘^cp_security_token=’ “$session_file” | head -1 | cut -d= -f2) denied_val=$(grep ‘^token_denied=’ “$session_file” | head -1 | cut -d= -f2) origin=$(grep ‘^origin_as_string=’ “$session_file” | head -1 | cut -d= -f2-) used=$(grep -a “$token_val” /usr/local/cpanel/logs/access_log | grep -m1 ” 200 “) external_auth=$(grep ‘^successful_external_auth_with_timestamp=’ “$session_file”) # High confidence if origin is badpass (session was pre-auth) if grep -q ‘^origin_as_string=.*method=badpass’ “$session_file”; then if [ -z “$external_auth” ] && [ -z “$used” ]; then echo “Found possible injected session file: $session_file” echo ” – No sign of usage” else echo “[!] CRITICAL: Exploitation artifact – token_denied with injected cp_security_token: $session_file” echo ” – cp_security_token=$token_val” echo ” – token_denied=$denied_val” echo ” – origin=$origin” echo ” – Verdict: Session was pre-auth (badpass origin) with attacker-injected token” echo ” – USED: $used” COMPROMISED=1 fi # Medium confidence but still suspicious for any session else echo “[!] WARNING: Suspicious session with token_denied + cp_security_token: $session_file” echo ” – cp_security_token=$token_val” echo ” – token_denied=$denied_val” echo ” – origin=$origin” echo ” – Review manually: may be legitimate token expiration or exploitation attempt” fi fi # IOC 1: Pre-auth session with authenticated attributes if [ -f “$preauth_file” ]; then if grep -qE ‘^successful_external_auth_with_timestamp=’ “$session_file”; then echo “[!] CRITICAL: Injected session detected: $session_file” echo ” – Contains ‘successful_external_auth_with_timestamp’ in pre-auth session” COMPROMISED=1 fi fi # IOC 2: Any session with tfa_verified but no valid origin if grep -q ‘^tfa_verified=1’ “$session_file” && \ ! grep -q ‘^origin_as_string=.*method=handle_form_login’ “$session_file” && \ ! grep -q ‘^origin_as_string=.*method=create_user_session’ “$session_file” && \ ! grep -q ‘^origin_as_string=.*method=handle_auth_transfer’ “$session_file”; then echo “[!] WARNING: Session with tfa_verified but suspicious origin: $session_file” COMPROMISED=1 fi # IOC 3: Password field containing newlines (corrupted session file) if grep -qzP ‘(?m)^pass=.*\n.’ “$session_file” 2>/dev/null; then echo “[!] CRITICAL: Multi-line pass value detected: $session_file” COMPROMISED=1 fi done if [ “$COMPROMISED” -eq 0 ]; then echo “” echo “[+] No indicators of compromise found.” else echo “” echo “[!] INDICATORS OF COMPROMISE DETECTED – IMMEDIATE ACTION REQUIRED” echo ” 1. Purge all affected sessions” echo ” 2. Force password reset for root and all WHM users” echo ” 3. Audit /var/log/wtmp and WHM access logs for unauthorized access” echo ” 4. Check for persistence mechanisms (cron, SSH keys, backdoors)” fi |
Sau đó, khởi chạy bằng lệnh:
# /bin/bash ./ioc_checksessions_files.sh
| # /bin/bash ./ioc_checksessions_files.sh
[*] Scanning session files for injection indicators… [!] CRITICAL: Exploitation artifact – token_denied with injected cp_security_token: /var/cpanel/sessions/raw/:Q3f8Ag2epeBuTaIZ – cp_security_token=/cpsess04396539398 – token_denied=1 – origin=address=100.96.3.23,app=whostmgrd,method=badpass – Verdict: Session was pre-auth (badpass origin) with attacker-injected token [!] WARNING: Session with tfa_verified but suspicious origin: /var/cpanel/sessions/raw/:Q3f8Ag2epeBuTaIZ [!] INDICATORS OF COMPROMISE DETECTED – IMMEDIATE ACTION REQUIRED 1. Purge all affected sessions 2. Force password reset for root and all WHM users 3. Audit /var/log/wtmp and WHM access logs for unauthorized access 4. Check for persistence mechanisms (cron, SSH keys, backdoors) File: ioc_checksessions_files.sh |
Tóm lại, CVE-2026-41940 là một lỗ hổng nghiêm trọng có thể dẫn đến mất toàn quyền kiểm soát hệ thống nếu không xử lý kịp thời. Việc cập nhật ngay lập tức, kiểm tra hệ thống và tăng cường bảo mật là những bước bắt buộc để bảo vệ hạ tầng trước nguy cơ bị tấn công.
Thông tin chi tiết tại:
Security: CVE-2026-41940 – cPanel & WHM / WP2 Security Update 04/28/2026 – cPanel