Sau
Source-aware lab referenceThe intended chain turns an exposed basket into a path to an internal web service, then turns a login field into shell syntax. The useful lesson is how those trust failures combine—and why this recreation's build and process settings cannot be taken for granted.
- 1. Public entry
55555 · Request BasketsA visitor-created basket can forward requests to a chosen URL. - 2. Boundary crossed
127.0.0.1:80 · MaltrailThe forwarding request originates inside the container network. - 3. Intended shell sink
POST /login · usernameThe patcher tries to reintroduce a shell-backed logger; compatibility is conditional. - 4. Process identity matters
Supervisor → container rootIf Maltrail starts, its service stanza does not drop privileges.
The lab in plain English
The project is configured to run two web services in one container. Request Baskets listens on port 55555, which Compose publishes to the host. Maltrail is configured for port 80, which is not published. An entrypoint firewall rule is intended to block non-loopback traffic to container port 80; its fallback binds Maltrail to loopback. A forwarding basket can request that internal URL and relay its response.
The second step depends on a deliberately vulnerable Maltrail patch. Its replacement string places the submitted username inside a command passed to subprocess.check_output(..., shell=True). If that replacement reaches a compatible login handler, failed login attempts can reach the shell without successful authentication. The Dockerfile, however, clones a moving upstream branch rather than the original v0.53 release.
The final README step assumes a puma shell followed by a journalctl pager escape. The checked-in Supervisor block omits user=puma. If the service starts under the supplied defaults, it runs as container root; a working injection would inherit that identity. Neither a root service nor a sudoers line proves that a particular exploit or pager route worked.
Three conditions the walkthrough does not establish
- Compatible Maltrail source: the upstream revision inspected on 17 November 2026 uses
syslog, not the subprocess logger expected by the patcher. Static comparison predicts a failed patch verification against that revision. - Correct first-stage identity: Maltrail is not configured to run as
puma. - Usable pager path:
journalctlis not explicitly installed, and secure-pager settings can disable shell escapes even if it is present.
See Lab build & boundaries for the evidence and conditions. No build was attempted.
What to notice first
- The basket's network position differs from the external requester's position.
- A proxied internal response proves a forwarding path, not command execution.
- A source checkout and a displayed version label are different evidence. This build is expected to report Request Baskets' version as
n/a. - Compose publishes only
55555, without an explicit localhost-only host bind. - Container root and host root are separate boundaries; this project defines no host-file mounts.
The central idea
Follow the destination, input interpretation, and process identity at every hop.
The central correction
The intended vulnerable image is not reproducibly pinned, and its puma-to-root ending is not supported by the supplied settings.
Show the bundled flag layout
The Compose default is a 32-character value. The entrypoint writes its first half to /home/puma/user.txt and its remaining half to /root/root.txt, with mode 0400 on both. The user file is assigned to puma; the root file is created by the root entrypoint. These are container paths, not mounted host files.
0123456789abcdef0123456789abcdefCustom values are split by length, not by a flag delimiter: for an odd length, the second half is one character longer. Change the default before sharing a running instance. The generated files and permissions have not been inspected at runtime.