CVE-2024-21626

Leaky Vessels: a file descriptor left open, and a container that is no longer contained

runc leaked an open file descriptor for the host filesystem into the container it was starting. A container image built to take advantage of that can reach out of its own filesystem and onto the host.

runcNot in CISA’s Known Exploited catalogueEPSS 18.9% chance of an attempt in 30 daysCVSS 8.6CWE-403CWE-668CWE-200CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H

A fixed package version is available on 4 of the releases below. Each row names the version, and the section below it says when this does not apply to you at all.

One read-only command checks how the server is set up. No account, no agent, nothing changed.

What it actually is

While setting up a container, runc left an internal file descriptor open across the boundary. A process inside the container that sets its working directory through that descriptor is then operating in the host filesystem rather than the container's.

What an attacker gets: Escape from the container to the host, with whatever privilege the container runtime holds. That is usually root.

When it applies to you, and when it does not

An old package version and a real exposure are different things. These are the conditions this one needs.

  • It needs a hostile image or a hostile Dockerfile, because the trigger is a working directory chosen at build or run time.
  • Anything running containers on the affected runc is in scope: Docker, Podman, Kubernetes and containerd all use it.
  • Restarting the containers is not enough. The daemon that uses runc needs restarting, and long-lived containers started under the old runtime should be recreated.

Check your own server

Read-only, changes nothing
runc --version 2>/dev/null; docker version --format '{{.Server.Version}}' 2>/dev/null; command -v podman >/dev/null && podman version --format '{{.Server.Version}}'

Whether a container runtime is on this machine at all, and its version. Many servers have runc installed as a dependency without running containers.

Fixed package version, per distribution

From each distribution’s own advisory data, asked per release. A version here is the package version that carries the fix on that release, not the upstream release number.

ReleaseSource packageStateFixed in
Ubuntu 22.04 LTSruncFixed1.1.7-0ubuntu1~22.04.2
Ubuntu 24.04 LTSruncNo advisory names itno advisory for this release names it
Debian 12 (bookworm)runcFixed1.1.5+ds1-1+deb12u1
Debian 13 (trixie)runcFixed1.1.12+ds1-1
Rocky Linux 9runcNo advisory names itNo Rocky Linux 9 advisory names it. AlmaLinux 9, rebuilt from the same Red Hat Enterprise Linux 9 source, fixed it in 4:1.1.12-1.el9_3 (ALSA-2024:0670).
AlmaLinux 9runcFixed4:1.1.12-1.el9_3

Install the fix with apt update && apt install --only-upgrade runc on Debian and Ubuntu, or dnf update runc on Rocky Linux and AlmaLinux. Restart whatever was using it afterwards: a patched file on disk is not a patched process in memory.

What SecAI has recorded about it

runc is a CLI tool for spawning and running containers on Linux according to the OCI specification. In runc 1.1.11 and earlier, due to an internal file descriptor leak, an attacker could cause a newly-spawned container process (from runc exec) to have a working directory in the host filesystem namespace, allowing for a container escape by giving access to the host filesystem ("attack 2"). The same attack could be used by a malicious image to allow a container process to gain access to the host filesystem through runc run ("attack 1"). Variants of attacks 1 and 2 could be also be used to overwrite semi-arbitrary host binaries, allowing for complete container escapes ("attack 3a" and "attack 3b"). runc 1.1.12 includes patches for this issue.

Recorded from nvd. Its weakness class is CWE-403 and CWE-668 and CWE-200, from NVD.

Read next

Other CVEs explained in full

Then check the rest of the server

The command above shows which version you run, and the table shows which version fixes CVE-2024-21626. One more read-only command, with no account and no agent, checks the rest of the server’s setup: SSH, the firewall, how many security updates are waiting, and signs that it has already been compromised. It changes nothing. It does not match your packages against advisories; SecAI’s agent does that, checking installed packages against published advisories every 12 hours.