Containers share the host’s kernel. That makes them light and fast, and it also means a mistake in how a container is set up can expose the host. One area that has caused real vulnerabilities is /proc, the Linux process filesystem. This guide explains why procfs matters for container isolation, what went wrong in a well-known runc vulnerability, and the settings that reduce the risk.
What runc and procfs are
runc is the low-level container runtime that creates and starts containers according to the Open Container Initiative (OCI) specification. Docker, containerd and many Kubernetes setups use it under the hood. It sets up namespaces, cgroups, capabilities and security profiles, then starts the container’s first process.
procfs, mounted at /proc, is a virtual filesystem that the kernel generates on the fly. It exposes information about running processes and the system: memory, CPU, open files, mounts and more. Some files under /proc can also be written to change kernel behavior. That’s why container runtimes limit what a container can see and touch there.
Know what matters before your first meeting.
Weekday mornings. Five minutes. What changed in security, why it matters.
By subscribing you agree to our Privacy Policy.
Free. Weekday mornings. 5 minutes or less.
Why procfs is sensitive for containers
Each process has an entry under /proc/<pid>/. Some of those entries, such as /proc/<pid>/exe and the file descriptors under /proc/<pid>/fd, behave like links back to real files and executables. If a process inside a container can reach entries that point to something on the host, the isolation boundary gets thin.
Runtimes defend against this in several ways: a separate PID namespace so the container only sees its own processes, masking or making read-only certain paths under /proc and /sys, dropping capabilities, and applying AppArmor or SELinux profiles and seccomp filters.
A real example: CVE-2019-5736
In February 2019, researchers disclosed CVE-2019-5736, a runc vulnerability. A malicious process running as root inside a container could overwrite the host’s runc binary by abusing /proc/self/exe during a container exec. The next time runc ran on the host, the attacker’s code ran with root privileges on the host. It affected Docker, containerd, Kubernetes and other platforms that used runc.
The fix made runc copy itself into memory before entering the container, so the binary on disk can’t be reached that way. Docker 18.09.2 shipped the patched version.
In 2024, another runc flaw, CVE-2024-21626 (“Leaky Vessels”), involved a leaked file descriptor that could give a container process access to the host filesystem. It was fixed in runc 1.1.12. Both cases show the same lesson: the runtime is part of your attack surface and needs patching like anything else.
Know what matters before your first meeting.
Weekday mornings. Five minutes. What changed in security, why it matters.
By subscribing you agree to our Privacy Policy.
Free. Weekday mornings. 5 minutes or less.
How to harden containers against procfs-based escapes
- Keep runc and your container engine updated. Check your version with
runc --versionand follow your distribution’s or vendor’s security advisories. - Don’t run containers as root. Set a non-root user in the image (
USERin the Dockerfile) or in the KubernetessecurityContextwithrunAsNonRoot: true. CVE-2019-5736 needed root inside the container. - Use user namespaces or rootless mode. With user namespace remapping, root inside the container maps to an unprivileged user on the host. Docker and Podman both support rootless operation.
- Avoid privileged containers.
--privilegedremoves most of the protections described here, including procfs masking. Grant individual capabilities only when an application really needs them, and drop the rest. - Keep the default PID namespace. Don’t use
--pid=hostorhostPID: trueunless you have a specific monitoring need, because it lets the container see host processes in/proc. - Leave masked paths alone. Docker and Kubernetes mask sensitive paths under
/procby default. Avoid options that remove those defaults, such as KubernetesprocMount: Unmasked. - Enforce mandatory access control. Keep the default AppArmor or SELinux profile enabled, and use the runtime’s default seccomp profile (
RuntimeDefaultin Kubernetes). - Block privilege escalation. Set
allowPrivilegeEscalation: falseand use a read-only root filesystem where the application allows it. - Protect the host’s runtime binaries. Keep them owned by root, on a read-only or immutable filesystem where possible, and watch them with file integrity monitoring.
- Use trusted images. Pull from known registries, scan images for vulnerabilities and sign them.
Detecting escape attempts
- Run a runtime security tool such as Falco, which ships rules for suspicious container behavior, including writes to sensitive host paths and unexpected shells.
- Alert on changes to container runtime binaries on hosts.
- Watch for containers started with privileged mode, host PID or host mounts, using an admission controller or Kubernetes Pod Security Standards (the “restricted” profile blocks most of these).
- Send container and host logs to a central place so an alert on one host can be investigated quickly.
If you suspect a container escape
Treat the host as compromised, not just the container. Isolate the node, preserve logs and disk images for investigation, rotate any secrets the host could reach, rebuild the node from a known-good image, and check other nodes for the same signs. Then work out how the attacker got into the container in the first place, since that entry point is still open.
For image-level controls, see our guides to container image security and tools to remove CVEs from container images.
Newer CyberExperts coverage on this topic
This article still works as background. If you want the current picture, start with the freshest related coverage below and today's brief.
CMMC After the Phase 2 Suspension: What Contractors Still Have to Do in 2026
Short answer: on July 13, 2026, the Department of War suspended the move to CMMC Phase 2, which was due on November...
Blue Team Certifications (2026): CySA+, GCIA, BTL1 and SC-200 Compared
Blue team certifications compared from the issuers' own pages: CompTIA CySA+ V4, GIAC GCIA, BTL1 from Centri (Security Blue Team) and Microsoft...
Digital Forensics Certifications (2026): GCFA, CHFI, EnCE and CCE Compared
Digital forensics certifications compared from the issuers' own pages: GIAC GCFA and GCFE, EC-Council CHFI, OpenText EnCE and ISFCE CCE, with exam...
Thursday’s brief: APT can install a swapped package, then Rails uploads, Xen hosts and old phones
The fastest way to catch up on what changed after this article was published.
Start your morning with the signal that matters.
Get the biggest cybersecurity developments, why they matter, and where to go deeper on CyberExperts.
By subscribing you agree to our Privacy Policy.
Free. Weekdays. Built for operators.