blog

    CopyFail, Dirty Pipe & DirtyFrag — Why CIS Guidelines for Docker Deployments Are Non-Negotiable

    Published Apr 18, 2026
    Updated Jun 12, 2026
    •

    A deep dive into the CopyFail Linux kernel vulnerability (CVE-2026-31431), its predecessors Dirty Pipe (CVE-2022-0847) and DirtyFrag, and why strict adherence to CIS Benchmarks for Docker deployments is your strongest line of defense against kernel-level container escapes.

    Copyfail Scatter

    The Linux Kernel Keeps Breaking Container Boundaries

    The Linux kernel is the shared foundation beneath every container on your host. When a vulnerability is found at the kernel level, every container on that host is potentially compromised — regardless of how well your application code is written. Three vulnerabilities in recent years illustrate this pattern with alarming clarity: Dirty Pipe, DirtyFrag, and the latest — CopyFail.

    Dirty Pipe (CVE-2022-0847) — Where It All Started

    Discovered by Max Kellermann at CM4all, Dirty Pipe exploited a flaw in the Linux kernel's pipe mechanism. By manipulating the PIPE_BUF_FLAG_CAN_MERGE flag, an unprivileged user could overwrite data in read-only files — including SUID binaries and files inside containers mounted from the host.

    The impact was devastating:

    • Privilege escalation from any unprivileged user to root
    • Overwriting read-only files including /etc/passwd
    • Trivial container escape when host volumes were mounted
    • Affected Linux kernel versions 5.8 through 5.16.10

    Dirty Pipe was a wake-up call: kernel bugs don't respect container boundaries.

    DirtyFrag — Exploiting Network Fragmentation

    The DirtyFrag exploit targets the Linux kernel's IP fragment reassembly logic. By crafting malicious fragmented network packets, attackers can trigger memory corruption in the kernel's networking stack. In containerised environments, this is particularly dangerous because:

    • Network namespaces share the same kernel networking code
    • A compromised container with network access can target the host kernel
    • It can be chained with other vulnerabilities for full container escape
    • Standard container network policies alone do not mitigate kernel-level flaws

    CopyFail — The Latest Kernel Page Cache Attack

    The CopyFail vulnerability represents the next evolution in Linux kernel exploitation. It targets the kernel's page cache and copy-on-write (CoW) mechanisms — the very foundations that make containers lightweight and efficient.

    CopyFail exploits race conditions in how the kernel manages shared memory pages between processes and containers. When containers share a base image layer (as nearly all Docker deployments do), the kernel uses CoW to save memory. CopyFail abuses this by:

    • Triggering race conditions during page fault handling
    • Corrupting shared pages that other containers or the host rely on
    • Enabling cross-container data leakage or code injection
    • Potentially allowing escape from container to host

    This is especially critical because the very mechanism that makes containers efficient (shared pages) becomes the attack surface.

    The Pattern Is Clear

    These three vulnerabilities share a common theme:

    VulnerabilityKernel SubsystemAttack VectorContainer Impact
    Dirty PipePipe / SpliceFile overwrite via pipe flagsEscape via mounted volumes
    DirtyFragNetwork / IP FragmentationMemory corruption via packetsEscape via network namespaces
    CopyFailPage Cache / CoWRace condition in shared pagesCross-container data corruption

    All three bypass application-level security, container runtimes, and even namespace isolation — because they attack the kernel itself.

    Why CIS Benchmarks for Docker Are Your Best Defense

    The CIS Docker Benchmark (published by the Center for Internet Security) provides a comprehensive hardening guide specifically for containerised environments. Following these guidelines won't patch kernel bugs, but it dramatically reduces the blast radius and limits the attack surface that kernel exploits can leverage.

    Key CIS Recommendations That Directly Mitigate These Threats

    1. Keep the Host Kernel Updated (CIS 1.1)

    This is the single most important defence. All three vulnerabilities above have patches available. Organisations that fell behind on kernel updates were exposed for weeks or months unnecessarily.

    2. Run Containers as Non-Root (CIS 4.1)

    Both Dirty Pipe and CopyFail have higher impact when the container process runs as root. Running as a non-root user with minimal capabilities significantly limits what an exploit can achieve even if triggered.

    3. Drop All Capabilities, Add Only What's Needed (CIS 5.3)

    docker run --cap-drop=ALL --cap-add=NET_BIND_SERVICE myapp
    

    Linux capabilities like CAP_SYS_ADMIN, CAP_NET_RAW, and CAP_DAC_OVERRIDE can turn a kernel bug into a full escape. Drop them all by default.

    4. Use Read-Only Root Filesystem (CIS 5.12)

    docker run --read-only myapp
    

    Dirty Pipe's primary attack is overwriting files. A read-only filesystem at the container level adds another layer of protection.

    5. Enable User Namespace Remapping (CIS 2.8)

    With user namespace remapping, root inside the container maps to an unprivileged user on the host. Even if an attacker escapes the container, they land as nobody.

    6. Limit Network Access (CIS 5.29)

    DirtyFrag requires network access to send crafted packets. Restricting inter-container networking and using network policies prevents lateral movement.

    7. Use Seccomp and AppArmor Profiles (CIS 5.2, 5.1)

    Seccomp profiles restrict which syscalls a container can make. Many kernel exploits rely on specific syscalls (e.g., splice for Dirty Pipe). Blocking unnecessary syscalls at the profile level stops exploits before they reach vulnerable kernel code.

    8. Don't Mount the Docker Socket (CIS 5.31)

    Mounting /var/run/docker.sock gives a container full control over the Docker daemon — essentially root on the host. Combined with any kernel exploit, this is game over.

    9. Use Minimal Base Images

    Fewer packages mean fewer potential tools for attackers. Alpine or distroless images reduce the attack toolkit available inside a compromised container.

    A Practical Hardened Docker Compose Example

    services:
      webapp:
        image: myapp:latest
        read_only: true
        user: "1000:1000"
        cap_drop:
          - ALL
        cap_add:
          - NET_BIND_SERVICE
        security_opt:
          - no-new-privileges:true
          - seccomp:default.json
        tmpfs:
          - /tmp
        networks:
          - frontend
        deploy:
          resources:
            limits:
              memory: 256M
              cpus: '0.5'
    

    Conclusion

    CopyFail, Dirty Pipe, and DirtyFrag are not isolated incidents — they are part of a recurring pattern of kernel-level vulnerabilities that erode the container isolation model. The Linux kernel will continue to have bugs. The question is not if the next one drops, but when.

    Organisations running Docker in production without following CIS Benchmarks are building on sand. Every unpatched host, every container running as root, every dropped Seccomp profile is an open door waiting for the next kernel CVE.

    Harden your Docker deployments now. Follow the CIS Benchmarks. The next CopyFail is already being discovered.

    Further Reading

    Update Appendix 12.06.2026

    Since the publication date of this article, both kernel patches have become available, but unfortunately, new variants and combinations have also emerged. Therefore, it is advisable to educate yourself on this matter and evaluate how to respond internally. Always refer to the latest CIS and CISA guidelines.