108

Podman rootless containers and the Copy Fail exploit

Anyone who sees Copy Fail and chooses to focus on the way the example exploit happens to gain root is just showing how unimaginative they are.

In the pre-container hype era, the sysadmin where I used to work gave us write access to nginx.conf on work machines to facilitate development. I used it in pair with an XSLT template to gain root access, so I could install things without having to go through the sysadmin - all thanks to a single config file for a webserver and without relying on any kind of security bugs in there. This vulnerability makes all sorts of stuff that were supposed to be shared read-only with the container actually sorta writable, so the blast radius is going to be enormous in many contexts, even when not as universally trivially exploitable as with the "su" example.

6 hours agoseba_dos1

Wait nginx ran as root?

5 hours agoe12e

It's usually launched as root and then drops its privileges for its workers. Unless... ;)

5 hours agoseba_dos1
[deleted]
5 hours ago

If you have write access to nginx.conf, you can set "user root root;"

5 hours agoApes

Long ago in Linux if you wanted to listen on a privileged port (< 1024) you had to do so as root.

5 hours agoadamsb6

If you're connecting to a host on a port < 1024, then you know a SysAdmin must have set it up, and it must be trustworthy. It was a simpler time.

5 hours agoApes

is that no longer true?

2 hours agotingletech

No, now you have the option of using CAP_NET_BIND_SERVICE

2 hours agobhaney

This is kind of an odd article to me. The point that podman may provide better isolation that Docker is made, but copy fail part focuses on the sample exploit (that overwrote su) which is not super applicable to containerised environments, and not the general effect of exploiting the vulnerability, which is to allow the user to overwrite a file that they should only have read-only access to.

https://github.com/Percivalll/Copy-Fail-CVE-2026-31431-Kuber... - This PoC has a good example of how Copy Fail might have an impact in a container based environment, it's exploiting the shared layers in a pair of container images, to overwrite a file in one image based on the running of an exploit in another.

Whilst I've not directly tested podman for that kind of attack, I'd be a bit surprised if it stopped it, given how this vuln works.

8 hours agoraesene9

The k8s exploit requires stars to be aligned for an external attacker: the pod you exploit (via an RCE?) must share some layers with a privileged pod running in the same node. Or alternatively, you should have the ability to run an arbitary image as an unprivileged pod. Which is surely, some environments where internal teams might have such access. But getting there for a remote attacker isn't easy.

5 minutes agocaptn3m0

Thanks for the link. I tried the copyfail PoC in rootless podman yesterday and it didn't work, but I hadn't dug into it yet. This is great info.

7 hours agofreedomben

I've had claude knock up a basic podman PoC, that seems to work ok https://github.com/raesene/vuln_pocs/tree/main/CVE-2026-3143... . It just uses a read-only mount and then demonstrates overwriting that read-only file.

Key point for testing exploitability is kernel version, package versions (in case they ship a patch) and loaded kernel modules. Some stripped down environments don't have the relevant modules available.

7 hours agoraesene9

I just don't trust the Linux kernel to effectively isolate processes anymore. Don't care if you're using user namespaces, seccomp, etc. There will be a bug.

Time for Micro VMs, they're a stronger security boundary (not perfect, stronger)

5 hours agowolttam

You can't really do anything useful with a VM either unless you start punching holes in those boundaries.

5 hours agoApes

I didn't say run in an air-gapped VM... Just as a means to better isolate the workloads I have running (some less trusted than others). Network connectivity and the associated vulnerabilities obviously remain.

5 hours agowolttam

No argument against VMs - just that they have a different risk profile and a different set of trade-offs than containers. They're not a silver bullet, but if they're working for you, then go for it.

4 hours agoApes

Exactly.

If your VM can't do anything, it's probably not very useful.

Doing things meaning reading / writing files, communicating between VMs, services, etc.

3 hours agoesseph

what about selinux?

3 hours agom463

While the sample exploit does not breakout of the container, with memory corruption everything is still on the table, those missing caps can be added back, no new privs can be unset, etc. It just not as straightforward as patching su.

6 hours agosamlinnfer

Has anyone made a sandbox site running every type of container and presenting a shell where users can try to break out of any uncompromised ones remaining?

It's self-evident that we should only run containers that haven't been pwned yet.

I suspect that with all of the CVE-20XX exploits, Heartbleed, Meltdown, Rowhammer, Spectre, etc, that we're all living in a fantasy and there simply are no secure containers.

3 hours agozackmorris

Seems a good place to repeat a quote from Theo de Raadt:

You are absolutely deluded, if not stupid, if you think that a worldwide collection of software engineers who can't write operating systems or applications without security holes, can then turn around and suddenly write virtualization layers without security holes.

He'd probably say the same about container architectures.