RunC 容器逃逸:Docker 和 Kubernetes 用户须知
RunC Container Escape: What Docker and Kubernetes Users Need to Know

原始链接: https://www.minimus.io/post/new-vulnerabilities-in-runc-allow-container-escape-what-docker-and-kubernetes-users-need-to-know

## runC 漏洞:重要的容器安全更新 最近,在 runC 中发现了三个高危漏洞,runC 是 Docker 和 Kubernetes 等流行平台使用的核心容器运行时。这些漏洞可能允许攻击者逃脱容器隔离并访问底层主机系统。 这些漏洞(CVE-2025-31133、CVE-2025-52565 和 CVE-2025-52881)源于容器设置过程中的竞争条件和不正确的验证,特别是与绑定挂载以及 `/proc` 写入的处理相关。攻击者可能通过恶意容器镜像或 Dockerfile 等方式操纵这些进程,以挂载任意文件或绕过安全保护。 利用这些漏洞需要能够自定义容器运行时配置,这凸显了供应链安全的重要性。**所有版本的 runC 均受到影响**,但已在 **1.2.8、1.3.3 和 1.4.0-rc.3** 及更高版本中修复。 强烈建议用户**立即升级 runC**,并实施最佳实践,例如验证镜像来源、利用用户命名空间以及在容器内以非 root 用户身份运行应用程序,以最大程度地降低风险。

Hacker News 新闻 | 过去 | 评论 | 提问 | 展示 | 招聘 | 提交 登录 RunC 容器逃逸:Docker 和 Kubernetes 用户需要了解的内容 (minimus.io) 13 分,dimastopel 发表于 2 小时前 | 隐藏 | 过去 | 收藏 | 1 条评论 TheDong 发表于 11 分钟前 [–] 博客垃圾邮件,试图推销他们的产品。直接阅读邮件列表帖子即可,这篇帖子没有任何价值。https://seclists.org/oss-sec/2025/q4/138 他们没有明确说明最重要的事情,即“如果您不运行不受信任的镜像,那么这些漏洞不会影响您,但您仍然应该尽快更新” 回复 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请 YC | 联系 搜索:
相关文章

原文

Recently, three high severity vulnerabilities were disclosed in runC, the low-level container runtime used by Docker, containerd, Kubernetes, and other container platforms. By exploiting these vulnerabilities, it is possible to bypass container isolation boundaries and break out of the container to the underlying host.

What is runC?

runC is the low-level container runtime that Docker, containerd, Kubernetes, CRI-O and others rely on to actually create containers and set up their isolation. While it exposes a CLI, its real role is behind the scenes: configuring namespaces, cgroups, mounts, and setting up the container’s filesystem and other interfaces before your container process starts. 

Why runC Vulnerabilities Matter for Docker and Kubernetes Security

Because runC is responsible for container isolation, any vulnerability affecting runC potentially affects the security boundary between the isolated container and the underlying host. This is why, for example, any workload running on top of Kubernetes can be affected.

Breaking Down CVE-2025-31133: “Masking” Turns Into Arbitrary Mount Gadget

The OCI runtime specification has a maskedPath feature that is supposed to hide sensitive files and directories (e.g. /proc/kcore, /proc/sysrq-trigger) by mounting something harmless on top. This protects against privileged users in non-user-namespaced being able to write to files or access directories that would provide sensitive information or allow containers to perform destructive or other privileged operations on the host. Files are masked by mounting the container’s /dev/null on top of the masked path.

In vulnerable versions of runC, the issue is that runC didn’t verify that the source of the bind-mount (container’s /dev/null) was a real /dev/null. If an attacker races and swaps it with a symlink to an attacker-controlled path, they could cause runC to bind-mount an arbitrary source path to a path inside the container, which can lead to a container escape.

Breaking Down CVE-2025-52565: /dev/console Bind-Mount Race

This is pretty similar in concept to the above mentioned CVE, but with a different target. runC bind-mounts /dev/pts/$n to /dev/console inside the container for interactive consoles. If an attacker races and swaps it with a symlink to an attacker-controlled path, runC will bind mount whatever that symlink points to. 

Since /dev/console bind mount happens before maskedPaths and readonlyPaths security features are applied, the attacker can potentially gain write access, which can lead to a container breakout.

Breaking Down CVE-2025-52881: LSM Bypass & Arbitrary /proc Write Gadgets

This is a more advanced variation of an older procfs/LSM vulnerability CVE–2019-19921. The flaw is in how runC handles writes to a /proc during container setup. 

With the right timing and mount tricks, an attacker can potentially redirect these writes to other, more dangerous files such as sysrq-trigger or core-pattern, which could lead to a container escape bypassing LSM label protections. 

What Is the Exploitability of These runC Vulnerabilities?

In order to be able to exploit above mentioned vulnerabilities, an attacker would need the ability to start containers with custom mount/runtime configs or to supply Dockerfiles that use custom mounts/clever build tricks via different tactics of a supply chain attack. Such can be achieved via malicious container images or Dockerfiles.

Which runC Versions Are Affected?

CVE-2025-31133

Affected versions: All

Fixed: 1.2.8, 1.3.3, 1.4.0-rc.3, and later

CVE-2025-52565

Affected versions: v1.0.0-rc3 and later

Fixed: 1.2.8, 1.3.3, 1.4.0-rc.3, and later

CVE-2025-52881

Affected versions: All

Fixed: 1.2.8, 1.3.3, 1.4.0-rc.3

Next Steps: How to Patch and Mitigate Vulnerable runC Versions

  • If you are running vulnerable versions of runC, upgrade to 1.2.8, 1.3.3, 1.4.0-rc.3 accordingly (or follow with vendor equivalent patches and instructions)
  • Verify the sources of container images and Dockerfiles
  • Follow security hygiene/good practices:
    • Use user namespaces to map container root to an unprivileged user on the host system
    • Prefer rootless containers when possible
    • Run applications as non-root inside the container to minimize risks

How can Minimus help?

Our team is constantly tracking vulnerabilities that might expose our images and packages to potential risks. As a provider of secure, minimal container images, we ensure that foundational components stay hardened and up to date.

When issues like these runC CVEs are disclosed, we patch and rebuild affected components, making sure that images that are relying on runC are secure from the above mentioned vulnerabilities. 

If you want to stay ahead of container-runtime vulnerabilities, explore Minimus images.

Minimus security advisories
联系我们 contact @ memedata.com