Overview
DoubleTake is an easy Linux machine built around an AI agent platform (“Zentara”) that is served from inside a Docker container. Only two ports are exposed: SSH on 22 and an HTTP service on 80 that is locked behind HTTP Basic Authentication. The SSH service is an OpenSSH 10.6 build compiled against musl, which makes it vulnerable to CVE-2026-123158, a password authentication bypass that lets any account carrying * in /etc/shadow be logged into if it is allowed to attempt password auth. On this host that account is the default alpine user, landing the first shell inside the container.
From there the box is a credential and container-escape exercise. A saved Firefox login in the alpine profile yields web credentials for the bob account, which is reused for SSH and reads the user flag. The web application exposes a “Deploy” feature that forwards uploaded archives to the Docker daemon’s PUT /containers/{id}/archive endpoint. Docker 29.5.0 is affected by CVE-2026-41567, where the daemon resolves decompression helpers such as xz from the container’s own overlay filesystem rather than the host’s, then runs them as host root. Overwriting /usr/bin/xz inside the container and uploading an xz-compressed archive causes the daemon to execute the planted binary with full host privileges.
The full chain is a clean illustration of how a single vulnerable language runtime (musl) and a single vulnerable daemon (Docker) combine with weak credential handling to go from an anonymous network position to host root.
| |
Reconnaissance
A full port scan followed by service and script enumeration on the open ports shows a minimal attack surface.
| |
| |
The HTTP service immediately challenges for credentials, which rules it out until something is recovered elsewhere:
| |
| |
The web app is a dead end without credentials, so SSH becomes the focus. The banner reports OpenSSH 10.6, and the service later turns out to be a musl-based build. OpenSSH 10.6 on a musl distribution without PAM is affected by CVE-2026-123158, a password authentication bypass disclosed in late 2026. That makes SSH the more promising entry point.
Initial Access
CVE-2026-123158 (SSHole)
The bypass is the result of several independent design decisions lining up:
- BSD convention stores
*in the shadow field of accounts that should never authenticate with a password. - musl’s
crypt()returns the literal string"*"on failure instead ofNULL. - musl’s SHA-256/512 implementation rejects keys longer than 256 bytes, so an oversized password forces that failure path and returns
"*". - OpenSSH’s fix for the old CVE-2016-6210 timing side channel borrows a
$6$salt from another local account when the target’s stored field is too short to serve as a salt, which routes a*account through musl’s SHA-512 path.
Put together, any account whose shadow field is * becomes loggable in if sshd lets it attempt password auth: an oversized password makes crypt() return "*", and sshd then compares that against the stored "*" with strcmp() and accepts it. root uses * but is protected by PermitRootLogin no. On this Alpine host the default alpine system account also carries * and is not restricted, so it is the viable target.
The bypass requires two password attempts on a single SSH connection. The first attempt’s salt lookup overwrites the static buffer holding the stored field, so it fails; but the borrowed salt is cached in a static variable. On the second attempt the stored * is reloaded while the cached salt is reused, and the comparison holds. The tester confirms exactly this, succeeding on attempt=2:
| |
| |
The bypass authenticates the session as alpine and provides command execution. To get a stable shell (and key-based scp for later file transfer), an attacker public key is written into the account’s authorized_keys:
| |
Logging back in with the matching private key gives a clean interactive shell as alpine.
Lateral Movement
The shell lands inside a Docker container (hostname 7f906e0ee8ec, an Alpine BusyBox userland). The SSH_CONNECTION environment variable confirms the container sits at 172.17.0.2 behind the Docker bridge:
| |
The alpine home directory holds a Firefox profile, which is a classic location for recoverable saved credentials:
| |
| |
The relevant files (logins.json, key4.db, cert9.db, profiles.ini) are pulled back to the attacker host over scp and fed to firefox_decrypt:
| |
| |
The host 172.17.0.1 is the Docker bridge gateway, i.e. the credentials are for the Zentara web app reached through the host. The profile uses encType 0 (no primary-password encryption), so the stored values are only base64-encoded and decode trivially:
| |
| |
bob is also a local account in the container. The same password works over SSH, and since user.txt is owned root:bob with 0640 permissions, bob can read it while alpine could not:
| |
| |
Privilege Escalation
Mapping the Deploy workflow
Authenticating to the Zentara web app with bob:CorrectHorseBatteryStaple exposes an AI agent platform. Two pages matter. The Status page reports the backend engine as Docker 29.5.0 (API 1.54, linux/amd64), running a workspace container named zentara-alpine. The Deploy page accepts .tar, .tar.gz, and .tar.xz uploads with a configurable target path, and its API documentation states that the platform forwards the archive to the container engine via PUT /containers/<container_name>/archive, decompressing .gz and .xz archives server-side before extraction.
That is the exact combination needed for a container escape.
CVE-2026-41567 explained
Docker’s PUT /containers/{id}/archive endpoint extracts an uploaded archive into a container. When the incoming stream is compressed, the daemon has to decompress it first. For some formats Docker uses pure-Go code, but for others it shells out to an external command-line helper: notably xz and unpigz. Formats handled entirely in Go (bzip2, zstd, and native gzip when unpigz is absent) are not affected.
The vulnerability is in how that helper binary is located. Instead of resolving xz/unpigz from a trusted path on the host, the daemon resolves the binary by name against the target container’s overlay filesystem. The binary that ends up executing is therefore whatever lives at /usr/bin/xz inside the container - but it runs in the daemon’s own context, not the container’s. That means:
- it runs as host root (the daemon’s uid),
- it inherits the daemon’s capabilities, including CAP_SYS_ADMIN,
- and it runs in the host PID namespace, outside the container’s isolation.
So an attacker who can both (a) write a file to /usr/bin/xz inside the container and (b) make the daemon decompress an xz archive destined for that container has arbitrary code execution as host root. The Zentara “Deploy” feature provides both primitives in one interface: the archive content controls what gets written where (primitive a, by extracting into /), and the archive compression controls which helper fires (primitive b, by uploading .tar.xz).
A process launched by the daemon with CAP_SYS_ADMIN in the host PID namespace can reach the real host root filesystem through PID 1. /proc/1/root is the root directory of the host init process, so mounting procfs and chroot-ing into /proc/1/root escapes the container entirely.
Building the trojan
The replacement xz does not decompress anything; it breaks out to the host and dials back a shell. It is compiled statically so it has no library dependencies inside the minimal container:
| |
| |
The binary is packaged at the path the daemon will resolve from the overlay, usr/bin/xz:
| |
Overwriting the container xz
The “Files” upload on the site is blocked by an expired API token, but the “Deploy” endpoint is reachable directly with bob’s credentials. Uploading plant.tar with the target path set to / extracts usr/bin/xz relative to the container root, overwriting the real /usr/bin/xz as root:
| |
| |
This step only plants the binary; it does not run it, because plain .tar extraction needs no decompression helper.
Triggering the exploit
A trivial xz-compressed archive provides the decompression trigger:
| |
With a listener ready on the attacker host:
| |
Uploading trigger.tar.xz through the same endpoint makes the daemon detect xz compression, resolve /usr/bin/xz from the container overlay (now the trojan), and execute it as host root. The reverse shell blocks the request handler, so a 500 response from the web app is the expected success indicator:
| |
| |
The listener catches a shell outside the container, on the host itself:
| |
The host root filesystem is now directly accessible (note cdrom, snap, lost+found, the Ubuntu *.usr-is-merged directories), confirming this is the host and not the Alpine container:
| |
| |
Detection and Mitigation
| Stage | Root cause | Mitigation |
|---|---|---|
| SSH auth bypass (CVE-2026-123158) | musl crypt() returns "*" on failure, combined with OpenSSH borrowing a $6$ salt for * accounts, so an oversized password matches a locked shadow field | Patch OpenSSH/musl; lock accounts with !/!! rather than *; ensure service/system accounts cannot attempt password auth; prefer key-only auth and PAM on affected builds |
| Saved Firefox credentials | Web credentials stored in a Firefox profile with encType 0 (no primary password), recoverable as base64 | Do not persist application logins in browsers on service hosts; set a primary password; use a secrets manager |
| Credential reuse (bob) | Same password used for the Zentara web login and the bob system account | Enforce unique credentials per service and per account; rotate on exposure |
| Container escape (CVE-2026-41567) | Docker 29.5.0 resolves xz/unpigz from the container overlay and runs them as host root with CAP_SYS_ADMIN during archive decompression | Patch Docker; never proxy user-supplied archives (or arbitrary extraction paths) to the Docker API; restrict the deploy target to a fixed workspace; drop CAP_SYS_ADMIN; run rootless Docker |
Detection signals:
- SSH authentication succeeding for a system/locked account (
alpine) that normally never logs in, and auth attempts carrying abnormally long passwords or multiple password attempts within a single connection. - A new
authorized_keysfile appearing in a service account’s home directory shortly after SSH access. - Deploy requests whose target path is
/or anything outside/workspace, or archives writing to system paths such asusr/bin/xz. - The Docker daemon spawning
xzorunpigzwith an unexpected child process (bash -i,/dev/tcp,chroot) or making outbound network connections, especially correlated withmount/chrootof/proc/1/root. - 500 responses on the deploy endpoint coinciding with the daemon hanging on a request.
Lessons Learned
- A memory-safe or hardened-looking service is only as safe as its underlying libc. The SSH bypass was not a flaw in OpenSSH logic alone but in how musl’s
crypt()and SHA implementation behaved at the edges, which is why the same OpenSSH version is safe on glibc. - Locked accounts must be truly non-authenticating. A
*shadow field is an assumption, not an enforcement; relying on it instead ofPermitRootLogin-style controls or explicit auth restrictions leftalpineexploitable. - Browsers are credential stores.
encType 0means the saved password was effectively plaintext, and a readable profile directory is equivalent to leaking those logins. - Credential reuse bridges trust boundaries. One password covered both the web app and a shell account, turning a saved web login into interactive access.
- Exposing a privileged daemon’s API through an application is exposing the daemon. Forwarding user-controlled archives and extraction paths to the Docker socket handed the attacker a code-execution primitive that ran as host root.
- Decompression is code execution. Any pipeline that shells out to helpers like
xz/unpigzmust resolve them from a trusted, fixed location, never from attacker-influenced filesystem state.
Command Reference
| |
Based on public write-ups of the Hack The Box machine DoubleTake.