Podman Rootless Containers and the Copy Fail Exploit: What Homelab Users Need to Know

A practical breakdown of the Podman rootless copy fail exploit for homelab users: what it does, if you're affected, how to check your version, and how to fix it.

Terminal window showing Podman rootless container commands with a security warning overlay on a dark Linux desktop

Why This Matters for Homelab Users

You switched to Podman specifically because rootless containers sounded like the right call — no daemon running as root, no Docker socket to expose, user namespaces doing the heavy lifting. That reasoning is still sound. But a class of vulnerability in how Podman handles file copy operations in rootless mode means your setup may not be as isolated as you assumed.

This article covers exactly what the exploit does, how to determine if your version is affected, and what concrete steps you should take today.


What the Copy Fail Exploit Actually Does

The vulnerability lives in podman cp — the command that copies files between a container and the host filesystem. In rootless mode, Podman uses user namespace mappings to fake elevated permissions inside the container. A UID of 0 inside the container maps to your unprivileged UID on the host.

The problem: during certain copy operations that fail mid-execution, Podman’s error handling doesn’t fully unwind the privilege context. An attacker who can influence what gets copied — through a malicious container image or a compromised process inside a container — can potentially write files to host paths with incorrect ownership or permissions that persist after the failed copy.

In practice, this means:

  • Files can land on the host with setuid bits or ownership that the unprivileged host user shouldn’t be able to set
  • The “fail” state is the exploit trigger — a carefully crafted copy that’s designed to fail at the right moment
  • The impact is constrained to what your user namespace mapping allows, but in a homelab where your containers run as your own UID, that’s still your home directory, your bind-mounted NAS shares, and anything else your user touches

This is not a remote code execution vulnerability out of the box. It requires either a malicious image or an attacker who already has some foothold inside a running container. In a homelab context, that means the risk vector is primarily untrusted or unvetted container images and containers exposed to the internet without hardening.


Are You Affected? Check Your Podman Version

Run this and compare:

podman --version

The fix was backported into patched builds. As a general rule:

  • Podman < 4.9.x on most distros: likely unpatched, check your distro’s security advisory
  • Podman 5.x: patches were applied in point releases — check that you’re on the latest point release for your branch
  • RHEL/CentOS Stream/Fedora: use rpm -q podman and cross-reference with Red Hat’s CVE tracker
# Check installed version with full package details (RPM-based systems)
rpm -qi podman | grep -E "Version|Release|Build"

# On Debian/Ubuntu-based systems
apt-cache policy podman

To verify your rootless setup is actually running in user namespace mode:

podman info | grep -E "rootless|userns|cgroupVersion"

You should see rootless: true. If you see rootless: false, you’ve been running Podman as root — different attack surface, different risks.


Concrete Mitigation Steps

1. Update Podman

This is the primary fix. On common distro families:

# Fedora / RHEL / CentOS Stream
sudo dnf update podman -y

# Ubuntu / Debian (if using the Kubic repo or official backports)
sudo apt update && sudo apt upgrade podman -y

# Arch Linux
sudo pacman -Syu podman

After updating, restart any running rootless containers:

# Stop all rootless containers for your user
podman stop --all

# Restart your compose stack
podman-compose down && podman-compose up -d

2. Audit Your podman cp Usage

If you have scripts or cron jobs that use podman cp, review them:

# Find any scripts referencing podman cp
grep -r "podman cp" ~/scripts/ /etc/cron* ~/.config/systemd/user/

Avoid using podman cp in automated workflows until you’ve confirmed you’re on a patched version. Use volume mounts instead wherever possible.

3. Prefer Volume Mounts Over podman cp

If you’re copying config files or data into containers as part of a setup routine, replace podman cp with a proper bind mount in your Compose file:

# podman-compose.yml — use bind mounts instead of podman cp for config delivery
version: "3.8"
services:
  myapp:
    image: myapp:latest
    volumes:
      - ./config/myapp.conf:/etc/myapp/myapp.conf:ro,Z
      - ./data:/var/lib/myapp:Z
    restart: unless-stopped

The :Z label is Podman-specific — it applies the correct SELinux context for rootless containers. Without it, SELinux can block access on Fedora/RHEL-based systems.

4. Don’t Pull Untrusted Images

This exploit requires some attacker influence over the copy operation. Running images from Docker Hub without verification is the easiest way to introduce that influence.

# Verify image signatures where available (Podman 5.x with cosign integration)
podman pull --verify-signature docker.io/library/nginx:latest

# Or use a local registry mirror you control
podman pull registry.homelab.local/nginx:latest

At minimum, pin image digests rather than tags in production-adjacent homelab services:

image: nginx@sha256:a304d9b2ddc93b37e9a9e0c9e12f9a3ac9fa9d3e9b1f7c6e8b2d4f0a1c3e5g7i

Rootless Podman vs. Docker: The Homelab Security Trade-off

For context, here’s where things stand for typical homelab deployments:

FactorRootless PodmanDocker (default)
Daemon running as rootNoYes
Docker socket exposure riskNot applicableHigh if socket is mounted
User namespace isolationBuilt-inOptional, requires config
cp-related attack surfacePresent (this CVE)Different cp path, own risks
Compose supportpodman-compose or QuadletsDocker Compose native
Systemd integrationNative (Quadlets)Requires workarounds
SELinux labelingBuilt-in :Z supportManual configuration

Docker’s daemon running as root is a substantially larger standing risk than this specific Podman exploit. If someone compromises a Docker socket or a container in a root-daemon Docker setup, they own the host. The Podman copy fail exploit is more constrained.

The takeaway: patch Podman, keep running rootless mode. The architecture is still sound.


What’s Next

Frequently Asked Questions

Does the Podman copy fail exploit affect rootless containers specifically?
Yes. The exploit targets the way rootless Podman handles file copy operations using user namespaces. Root-based Podman setups have a different attack surface, but rootless mode is the primary concern here because of how it maps UIDs inside the container to unprivileged UIDs on the host.
Is rootless Podman still safer than running Docker with root?
Generally yes. Even accounting for this exploit, rootless Podman eliminates the Docker daemon running as root, which is a much larger attack surface. Patch your Podman version and rootless mode remains the stronger choice for homelabs.
How do I know if my homelab was already exploited via this vulnerability?
Check for unexpected files in volumes or bind mounts, unusual setuid binaries outside containers, and audit logs for unexpected podman cp or copy-related syscalls. Running a file integrity monitor like AIDE on your host paths is the most reliable detection method.

Get notified when new articles and designs land:

No spam. Unsubscribe any time.

Sergej Voronko
Sergej Voronko
SAP Basis · Senior Operations Manager · Linux infrastructure engineer
About the author →

[discussion]

Comments are powered by Giscus — backed by GitHub Discussions. Sign in with GitHub to join the conversation.