POSIXフリート監査ツール、ゼロトラストのsshd設定、Ansibleロールバック、Falco eBPFルールを通じて、OpenSSH musl認証バイパス(CVE-2026-123158)への露出を監査・堅牢化・検出します。
OpenSSH musl Salt-Truncation 認証バイパス (CVE-2026-123158 / OpenSSH 10.6p2) 向けエンタープライズ多層防御、脆弱性監査、ゼロトラストハードニングツールキット
2026年11月、セキュリティ研究者は musl libc に対してコンパイルされた OpenSSH サーバー(主に Alpine Linux)における、認証不要のリモート認証バイパス脆弱性を公表しました。特定の前提条件の下で、256〜1,024 バイトの過大なパスワード文字列を送信すると、内部の文字列比較が一致し、認証情報なしで不正な対話型シェルまたは root アクセスが許可されます。
この欠陥は、独立したコンポーネント間のアーキテクチャ上の契約衝突に起因します:
/etc/shadow のパスワードフィールドにアスタリスク * で表されます。$5$)、SHA-512 ($6$)、yescrypt ($y$)、または bcrypt ($2b$) のソルトを借用します。! でプレフィックスされたロック済みアカウント、期限切れアカウント、または不正なハッシュはソルト提供元として機能できません。musl libc の crypt_sha512.c および crypt_sha256.c の実装は、パスワードキーの最大長を 256 バイト (KEY_MAX) に制限しています。入力長が 256 バイト以上に達すると、musl はハッシュダイジェストを計算する代わりに、リテラルのエラーセンチネル文字列 * を返します。strcmp("*", "*") == 0 を実行し、認証チェックを成功と評価します。重要な修復指示: 決定的な修復は、ベンダーがパッチを適用したパッケージを導入することです。システム管理者は直ちにベンダーの更新を適用する必要があります:
- アップストリームリリース: OpenSSH 10.6p2
- Alpine Linux 公式バックポート:
- Alpine 3.24:
openssh-10.3_p1-r2- Alpine 3.23:
openssh-10.2_p1-r1- Alpine 3.22:
openssh-10.0_p1-r11- Alpine 3.21:
openssh-9.9_p2-r1⚠️ 運用上の警告: Alpine Linux では、
apk add -u opensshを実行するとディスク上のバイナリは更新されますが、実行中の sshd サービスは再起動されません。アンリンクされた脆弱なコードをプロセスメモリからフラッシュするには、デーモンを再起動する (rc-service sshd restartまたはコンテナの再デプロイ) 必要があります。バイナリ置換の前に適格性確認期間を必要とするエンタープライズ環境では、プロトコルレベルの緩和策が露出を完全に排除します。このリポジトリは、自動化されたフリート監査、ユニバーサルなゼロトラストのドロップイン設定、検証済みの補償ロールバックを備えた Ansible デプロイ自動化、および eBPF ランタイム検出ルールを提供します。
flowchart TD
classDef l1 fill:#022c22,stroke:#10b981,stroke-width:2px,color:#f8fafc;
classDef l2 fill:#1e293b,stroke:#38bdf8,stroke-width:2px,color:#f8fafc;
classDef l3 fill:#2e1065,stroke:#a855f7,stroke-width:2px,color:#f8fafc;
classDef l4 fill:#451a03,stroke:#f59e0b,stroke-width:2px,color:#f8fafc;
L1["Layer 1: Primary Prevention\nVendor Patch and Hardening\nPasswordAuth Disabled"]:::l1
L2["Layer 2: Exposure Assessment\nPOSIX Fleet Auditor v1.1.6\n5-State SCAP/OVAL Engine"]:::l2
L3["Layer 3: Runtime Detection\nFalco eBPF Security Rules\nCredential Tampering Defense"]:::l3
L4["Layer 4: Verification Gate\n30-Scenario Regression Suite\nUbuntu + Alpine CI Matrix"]:::l4
L1 --> L2
L2 --> L3
L3 --> L4
PasswordAuthentication no、KbdInteractiveAuthentication no)。audit_openssh_immunity.sh)。PIDプロセス識別 (/proc/$PID/comm)、パッケージ所有権 (apk info -W、dpkg -S、rpm -qf)、メモリ内実行ファイルの一致 (/proc/$PID/exe)、デーモンコマンドライン -f の設定復元、厳格な9フィールド /etc/shadow レコード、および全フィールドをアンカーとしたアルゴリズム固有のモジュラーcryptハッシュを検証します。tests/test_auditor.sh)。GitHub Actions CIにおいてUbuntu (glibc) とAlpine Linux (musl libc) の両方で実行されます。| コンポーネント | 標準 / 指令 | このリポジトリでの実装 | 技術的機能 |
|---|---|---|---|
| 認証プロトコル | CIS Benchmark 5.2.11 | PasswordAuthentication no | プロトコル層でパスワードクエリを終端; crypt関数を完全にバイパス |
| キーボードインタラクティブ | CIS Benchmark 5.2.12 | KbdInteractiveAuthentication no | PAMチャレンジレスポンスのパスワードフォールバックを無効化 |
| ルート公開鍵アクセス | CIS Benchmark 5.2.5 | PermitRootLogin prohibit-password | 管理アカウントのパスワード認証を禁止 |
| アルゴリズム制限 | CIS Benchmark 5.2.14 | PubkeyAcceptedAlgorithms ... | 現代的な楕円曲線標準 (ED25519 / ECDSA / RSA-SHA2) を強制 |
| PAM委譲 | OpenSSH Portable Standard | UsePAM yes | 認証実行をPAMモジュールに移行; PAM非搭載のmuslビルドでは安全に無視される |
| アカウントシャドウガード | Linux Shadow Standard | passwd -l <user> (! を強制) | ロックされた * センチネルを ! に置換し、文字列比較の衝突を防止 |
外部ランタイムをデプロイせずにフリートシステムを評価するには、POSIX監査スクリプトをダウンロードし、暗号化ダイジェストを検証してから実行します:
# 1. Download auditor script and canonical SHA-256 digest
curl -sSLO https://raw.githubusercontent.com/mc493/openssh-musl-enterprise--hardening-cve-2026-123158/main/audit/audit_openssh_immunity.sh
curl -sSLO https://raw.githubusercontent.com/mc493/openssh-musl-enterprise--hardening-cve-2026-123158/main/audit/audit_openssh_immunity.sh.sha256
# 2. Verify cryptographic SHA-256 digest
sha256sum -c audit_openssh_immunity.sh.sha256
# 3. Execute fleet inspection
chmod +x audit_openssh_immunity.sh
./audit_openssh_immunity.sh
本番環境での偶発的な環境変数の漏洩を防ぐため、--internal-test-mode CLI フラグと AUDIT_ENABLE_TEST_HARNESS=1 環境変数の両方が指定されない限り、すべてのモックオーバーライド(AUDIT_MOCK_*)は無条件に解除されます。注: このデュアルゲートはテスト分離の仕組みであり、プロセスの起動を制御する信頼できない呼び出し元に対する特権境界ではありません。
Ansible、Datadog、または集中ログ取り込みとの統合には:
./audit_openssh_immunity.sh --json
JSONテレメトリの例 (v1.1.6 5状態スキーマ、PID識別情報とパッケージ来歴付き):
{
"timestamp": "2026-11-06T21:40:00Z",
"auditor_version": "1.1.6",
"verdict": "NOT_AFFECTED",
"reason": "Host runs GNU C Library (glibc); crypt() does not return '*' on oversized password inputs (256-1024 bytes)",
"operational_status": {
"binary_provenance": "verified",
"pid_identity_verified": true,
"package_owned": true,
"restart_required": false,
"test_harness_active": false
},
"details": {
"libc_type": "glibc",
"sshd_binary": "/usr/sbin/sshd",
"sshd_pid": "3622",
"pid_identity_verified": 1,
"package_owned": 1,
"active_config_file": "/etc/ssh/sshd_config",
"is_deleted_binary": 0,
"binary_provenance": "verified",
"restart_required": false,
"test_harness_active": false,
"sshd_pam_linkage": "pam_linked",
"effective_pam": 1,
"password_authentication": "no",
"kbd_interactive_authentication": "no",
"use_pam": "yes",
"package_version": "OpenSSH_9.6p1 Ubuntu-3ubuntu13.20",
"is_patched": 0,
"has_star_target_account": -1,
"has_valid_salt_donor": -1,
"has_conditional_match_blocks": 0,
"match_block_enables_password_auth": 0
}
}