REDHAT-BUG-2577547: High severity Red Hat crun vulnerability
A flaw was found in crun. For a tmpfs mount with tmpcopyup, processsinglemount() opens the destination and attaches the tmpfs, and handletmpcopyup() then opens that destination again by name without ONOFOLLOW and copies the image files there. A container that shares a writable volume with the container being created can rename a path component to a symlink between the two lookups, so crun, running as host root, writes the image files onto host files. Those files include /proc/sys and files on a volume mounted read-only in another container. The copy keeps the source owner and mode, including the set-user-ID bit. The same second lookup by name is used for the recursive mount options rro, rnosuid, rnodev, and rnoexec. The lookup was added in commit 1fac50d, crun 0.9. Releases through 1.30.1 are affected, and current upstream main still has the open.
Affected Software
Event History
Frequently Asked Questions
Which environments are exposed to this issue?
Containers created with crun are exposed when a tmpfs mount uses tmpcopyup and another container shares a writable volume with the container being created. The shared writable volume gives the other container an opportunity to alter path resolution during creation.
What does an attacker need to exploit it?
An attacker needs control from a container that shares a writable volume with a target container while that target is being created. They must race the two path lookups by renaming a path component to a symlink between them.
What is the potential impact of successful exploitation?
Because crun performs the copy as host root, the attacker can cause image files to be written to host files through the substituted symlink. The copied files retain their source ownership and modes, including set-user-ID bits; affected targets can include /proc/sys files and files on a volume mounted read-only in another container.
How can I determine whether my crun deployment may be affected?
The vulnerable lookup was introduced in crun 0.9, and releases through 1.30.1 are affected. The provided data also states that the issue remains present in current upstream main.