Files
podman/pkg/domain/infra/abi/play_linux.go
Paul Holzinger 2ef1cd7f7e [v5.4-rhel] kube play: don't follow volume symlinks onto the host
For ConfigMap and Secret kube play volumes podman populates the data
from the yaml. However the volume content is not controlled by us and we
can be tricked following a symlink to a file on the host instead.

Fixes: CVE-2025-9566

Fixes: https://issues.redhat.com/browse/RHEL-113141,
https://issues.redhat.com/browse/RHEL-113152,
https://issues.redhat.com/browse/OCPBUGS-61268,
https://issues.redhat.com/browse/OCPBUGS-61270

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
2025-09-08 18:05:00 -04:00

19 lines
403 B
Go

//go:build !remote
package abi
import (
"os"
securejoin "github.com/cyphar/filepath-securejoin"
)
// openSymlinkPath opens the path under root using securejoin.OpenatInRoot().
func openSymlinkPath(root *os.File, unsafePath string, flags int) (*os.File, error) {
file, err := securejoin.OpenatInRoot(root, unsafePath)
if err != nil {
return nil, err
}
return securejoin.Reopen(file, flags)
}