Skip to content
CSRF Write-up Intermediate

Podman API service listening on TCP can be used from websites

The Podman API service, when listening on TCP (even localhost), accepts simple HTTP requests from any website, allowing cross-site request forgery. An attacker can create and start containers, leading to arbitrary code execution as the user running the service.

Dennis Dast Follow

Published on proofnet.de

Podman is a tool for running containers. While Podman is used without a daemon most of the time, it also supports running as a daemon / API service, similar to Docker.

Dennis Dast, on proofnet.de

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

Impact

An attacker could execute arbitrary code as the user running the API service, but only if the service is in TCP mode and the victim uses a browser on the same machine; Chromium requires TLS for localhost access.

What the attacker needed

Podman API service running in TCP mode; Victim uses a web browser on the same machine; Attacker hosts a malicious webpage; Chromium requires TLS for localhost access

The fix

The behaviour was not changed; instead, documentation was updated to warn against TCP mode and recommend using a Unix socket or SSH forwarding.

How it was found

  1. Start the Podman API service in TCP mode, e.g., on localhost.
  2. Visit a malicious website in a browser on the same machine.
  3. The website sends a POST request to download an Alpine container image.
  4. After a delay, it sends a POST request to create a container that bind-mounts /home and modifies .bashrc.
  5. After another delay, it sends a POST request to start the container, executing the modification.

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.

Podman is a tool for running containers. When its API service listens on a TCP port, any website you visit can send it commands because web browsers allow simple requests to other origins. This lets a malicious site create and start a container that runs code on your computer as your user.

What is CSRF?

Another site makes a signed-in user's browser perform an action they did not intend.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site request forgery (CSRF)

The lesson behind this report.

Another site makes a signed-in user's browser perform an action they did not intend.