CVE-2025-9566: podman kube play symlink traversal vulnerability
8.1
Basic Information
Technical Details
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
github.com/containers/podman/v5 | go | <= 5.6.0 | 5.6.1 |
github.com/containers/podman/v4 | go | <= 4.9.5 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability exists in the podman kube play
command, specifically within the playKubePod
function, which handles the creation of files from Kubernetes ConfigMaps and Secrets into volumes. The root cause is the use of os.Create
to write files to the volume. This function follows symbolic links, which creates a time-of-check-to-time-of-use (TOCTOU) vulnerability. An attacker could exploit this by running a pod that creates a symbolic link inside the volume, pointing to a sensitive file on the host system. When podman kube play
is executed again with the same volume, the playKubePod
function follows the symlink and overwrites the targeted host file with the contents specified in the ConfigMap or Secret. The provided patch rectifies this by replacing the vulnerable os.Create
call with a new, safer function called openPathSafely
. This new function uses unix.Openat
with the O_NOFOLLOW
flag to explicitly prevent following symbolic links, and further contains file operations within the intended directory using securejoin
, thus closing the symlink traversal vulnerability.
Vulnerable functions
github.com/containers/podman/v5/pkg/domain/infra/abi.ContainerEngine.playKubePod
pkg/domain/infra/abi/play.go