Leaky Vessels Flaws Enable Container Escape in runC and BuildKit

· Original article ↗

Summary

Four runC and BuildKit flaws could enable host access or container escape through crafted images, Dockerfiles, or build steps. The article details affected versions, exploitation risks, patches, and prioritization advice.

Key points

  • CVE-2024-21626 affects runC versions before 1.1.12; leaked file descriptors can expose the host filesystem and may enable container escape.
  • CVE-2024-23651, CVE-2024-23652, and CVE-2024-23653 affect BuildKit versions before 0.12.5, with risks involving malicious build steps, Dockerfiles, or elevated-privilege container execution.
  • Exploitation generally requires control of a container image, Dockerfile, BuildKit frontend, or launch arguments, or a victim executing into a vulnerable container.
  • Potentially higher-risk environments include container-as-a-service offerings, build pipelines with anonymous access, and hosts running externally sourced images.
  • Wiz reports that at least 80% of cloud environments have instances vulnerable to CVE-2024-21626.
  • Patches are available in runC 1.1.12, BuildKit 0.12.5, Moby 25.0.2, and Docker Desktop 4.27.1; the article also recommends prioritizing container hosts and using trusted images and build sources.
  • Wiz says its Runtime Sensor can detect live CVE-2024-21626 exploitation attempts starting with sensor binary v1.0.3491 and definitions v1.0.848.

Article Details

Vulnerability Types
  • Container escape via leaked file descriptors and host filesystem access
  • Race condition in concurrent BuildKit build steps
  • Improper cleanup of mountpoint files allowing removal of host files
  • BuildKit API privilege escalation
Affected Versions
  • runC versions before 1.1.12
  • BuildKit versions before 0.12.5
Exploitation Status
reported
Exploit Availability
unknown
Patch Status
available
Workarounds
  • Use only container images from trusted sources and build only from trusted Dockerfiles.
  • Avoid using BuildKit frontends from untrusted sources.
  • Harden image registries and build pipelines against anonymous write access.

MITRE ATT&CK

CVE

Vendors

Products

Related Articles