Skip to content
RCE Write-up Advanced

From Application RCE to Full Host Takeover via Docker Socket Misconfiguration

A server-side template injection in a report-generation feature allowed command execution inside the application container. The container had the Docker socket mounted, so the attacker could use the Docker daemon to mount host files and take over the host.

S3THU Follow

Published on medium.com

In modern cloud-native applications, containerization has become the default deployment model. Docker provides strong isolation between applications and the underlying host system, making it appear as though each service runs in a sandboxed environment.

Sethu Satheesh, on medium.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the report rendering engine evaluated user input as template expressions without sandboxing, and the container was given access to the host's Docker socket.

Impact

The attacker could read host files and gain full administrative control over the host, breaking container isolation.

What the attacker needed

Access to the report feature; Docker socket mounted in the container

The fix

The Docker socket should not be mounted into untrusted containers; instead, a restricted proxy should mediate access to the Docker daemon.

How it was found

  1. Use the report feature to supply input that the backend evaluates as an expression.
  2. Confirm expression evaluation with arithmetic and object traversal.
  3. Probe for system-level execution and environment access.
  4. Run operating system commands inside the container.
  5. Enumerate the container filesystem and find the Docker socket mounted.
  6. Use the Docker socket to create containers that mount host paths and take over the host.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

The report feature let users put in special expressions that the server evaluated instead of just displaying as text. That let an attacker run commands inside the container. The container also had a direct connection to Docker, the software that manages containers on the host, so the attacker could use it to control the host.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

More by S3THU

View all

1 more disclosed report, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.