Audits, hardens, and detects exposure to the OpenSSH musl authentication bypass (CVE-2026-123158) via a POSIX fleet auditor, zero-trust sshd configs, Ansible rollback, and Falco eBPF rules.
Enterprise Defense-in-Depth, Vulnerability Auditor, and Zero-Trust Hardening Toolkit for OpenSSH musl Salt-Truncation Authentication Bypass (CVE-2026-123158 / OpenSSH 10.6p2)
In November 2026, security researchers disclosed an unauthenticated remote authentication bypass vulnerability in OpenSSH servers compiled against musl libc (predominantly Alpine Linux). Under specific preconditions, supplying an oversized password string between 256 and 1,024 bytes triggers an internal string comparison match that grants unauthorized interactive shell or root access without credentials.
The flaw results from an architectural contract collision between independent components:
* in the /etc/shadow password field.$5$), SHA-512 ($6$), yescrypt ($y$), or bcrypt ($2b$) salt from an active, unlocked account on the host. Locked accounts prefixed with !, expired accounts, or malformed hashes cannot act as salt donors.musl libc implementation of crypt_sha512.c and crypt_sha256.c enforces a 256-byte maximum password key length (KEY_MAX). When input length reaches or exceeds 256 bytes, musl returns the literal error sentinel string * instead of computing a hash digest.strcmp("*", "*") == 0, evaluating the authentication check as successful.CRITICAL REMEDIATION DIRECTIVE: The definitive remediation is deploying vendor-patched packages. System administrators must apply vendor updates immediately:
- Upstream Release: OpenSSH 10.6p2
- Alpine Linux Official Backports:
- 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⚠️ OPERATIONAL WARNING: On Alpine Linux, running
apk add -u opensshupdates the binary on disk, but does not restart the running sshd service. The daemon must be restarted (rc-service sshd restartor container redeploy) to flush the unlinked, vulnerable code from process memory.In enterprise environments requiring qualification windows prior to binary replacement, protocol-level mitigation completely eliminates exposure. This repository provides automated fleet auditing, universal zero-trust drop-in configurations, Ansible deployment automation with verified compensating rollback, and eBPF runtime detection rules.
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) verifying PID process identity (/proc/$PID/comm), package ownership (apk info -W, dpkg -S, rpm -qf), in-memory executable parity (/proc/$PID/exe), daemon command-line -f config recovery, strict 9-field /etc/shadow records, and full-field anchored algorithm-specific modular crypt hashes.tests/test_auditor.sh) executed across both Ubuntu (glibc) and Alpine Linux (musl libc) in GitHub Actions CI.| Component | Standard / Directive | Implementation in this Repository | Technical Function |
|---|---|---|---|
| Authentication Protocol | CIS Benchmark 5.2.11 | PasswordAuthentication no | Terminates password queries at protocol layer; bypasses crypt function entirely |
| Keyboard Interactive | CIS Benchmark 5.2.12 | KbdInteractiveAuthentication no | Disables PAM challenge-response password fallback |
| Root Public Key Access | CIS Benchmark 5.2.5 | PermitRootLogin prohibit-password | Prohibits password authentication for administrative accounts |
| Algorithm Restriction | CIS Benchmark 5.2.14 | PubkeyAcceptedAlgorithms ... | Enforces modern elliptic-curve standards (ED25519 / ECDSA / RSA-SHA2) |
| PAM Delegation | OpenSSH Portable Standard | UsePAM yes | Shifts authentication execution to PAM modules; safely ignored on no-PAM musl builds |
| Account Shadow Guard | Linux Shadow Standard | passwd -l <user> (enforcing !) | Replaces locked * sentinel with ! to prevent string comparison collisions |
To assess fleet systems without deploying external runtimes, download the POSIX auditor script, verify the cryptographic digest, and execute:
# 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
To prevent accidental environment variable bleed in production environments, all mock overrides (AUDIT_MOCK_*) are unconditionally unset unless both the --internal-test-mode CLI flag and AUDIT_ENABLE_TEST_HARNESS=1 environment variable are supplied. Note: this dual gate is a test-isolation mechanism, not a privilege boundary against an untrusted caller who controls process invocation.
For integration with Ansible, Datadog, or centralized log ingestion:
./audit_openssh_immunity.sh --json