What do a runc escape, a poisoned base image, and a misconfigured Kubernetes cluster have in common? All three have caused real-world container security failures at organizations that thought their pipelines were safe. Containers make software faster to ship, but they also concentrate risk in places many teams never look: the host kernel, the image registry, and the API server. This article walks through concrete container security examples, from landmark CVEs to everyday configuration mistakes, and pulls out the practical lessons that actually prevent the next incident. (How much social security will i get at 62) (Kubernetes Security Concepts)
Why Container Security Failures Look Different
Traditional hosts fail one at a time. Containers fail in bulk. A single vulnerable base image can be replicated into hundreds of pods within minutes, and a single misconfigured role binding can expose an entire cluster. That amplification effect is why the official guidance matters so much: the NIST SP 800-190 application container security guide treats image, registry, orchestrator, container, and host OS as separate layers, each needing its own controls.
The examples below follow that same layered logic. Each one shows where a control was missing and what teams now do differently. If you are also hardening the devices and accounts around your infrastructure, the same defense-in-depth thinking shows up in guides about endpoint protection and in physical-layer advice about home security systems. Good security habits travel well across domains.
Example 1: The runc Escape (CVE-2019-5736)

In early 2019, researchers disclosed CVE-2019-5736, a flaw in runc, the low-level runtime that starts most containers. An attacker who could run a container could overwrite the host’s runc binary and break out onto the host itself. Because runc sat underneath Docker, Kubernetes, and containerd, the blast radius was enormous.
The practical lesson: the runtime is part of your attack surface, not a black box. Teams now pin runtime versions, rebuild nodes from fresh images instead of patching in place, and treat “container escape” as a realistic threat rather than a theoretical one. The CVE record itself is worth reading for anyone who wants to see how a single binary became the weak link for an entire ecosystem.
A related 2024 cluster of flaws, nicknamed Leaky Vessels, hit runc and BuildKit with similar escape paths. The pattern repeats: low-level tooling is where the sharpest bugs hide.
Example 2: BuildKit and Image Build Compromise
The Leaky Vessels disclosures in January 2024 showed that the build stage is just as dangerous as runtime. Vulnerabilities in BuildKit, Docker’s build engine, could let a malicious Dockerfile reach the host filesystem during a build. That matters because CI runners often hold registry credentials and deployment keys.
Here is what teams changed after those disclosures:
- Build untrusted code in disposable, isolated runners, never on a shared build host.
- Treat Dockerfiles from pull requests as untrusted input and require review before merge.
- Rotate registry and deployment credentials regularly, so a build-time leak has a short shelf life.
- Pin BuildKit and Docker versions and watch the vendor security advisories.
The broader point is that supply chain attacks do not need a clever exploit. The xz-utils backdoor (CVE-2024-3094), disclosed in March 2024, showed how a patient attacker can slip malicious code into a widely used open-source component. Container base images inherit exactly that kind of risk.
Example 3: The Kubernetes API Server Privilege Escalation (CVE-2018-1002105)
Late in 2018, Kubernetes disclosed CVE-2018-1002105, a flaw in the API server’s proxy that allowed an authenticated user to escalate privileges and potentially take over a cluster. It was a wake-up call about RBAC hygiene.
Common mistakes that make such flaws far worse:
- Granting `cluster-admin` to service accounts “just to get things working.”
- Leaving the API server reachable from the public internet.
- Sharing kubeconfig files across teams and CI systems.
- Never auditing role bindings after a person leaves a project.
What works in practice is boring but effective: least-privilege roles, separate namespaces per team, network policies that block lateral movement, and regular reviews of who can do what. The NSA and CISA Kubernetes hardening guidance lays out these controls in plain language, and it is one of the most practical documents available for cluster operators.
Example 4: ingress-nginx Annotation Injection (CVE-2023-5044)
In 2023, the popular ingress-nginx controller shipped fixes for CVE-2023-5044 and related flaws. A user who could create or edit an Ingress object could inject code through annotations and potentially steal credentials. The example is instructive because the attacker did not need shell access to a node. They only needed permission to create a Kubernetes object.
This is a classic case of privilege confusion: teams lock down pods but forget that Ingress, ConfigMap, and Secret permissions are just as sensitive. A user who can edit a Secret can often read every credential the workload uses. The fix is to treat Kubernetes RBAC as a full permission model, not a pod-only one.
Example 5: The Poisoned Base Image
Not every container incident has a CVE. One of the most common real-world failures is the poisoned or stale base image. A team pulls `latest`, the image contains an old OpenSSL build or an abandoned package, and months later a scanner lights up with dozens of critical findings.
What actually works here:
- Pin image digests, not tags. Tags move; digests do not.
- Scan images in CI and in the registry, because new CVEs appear after you build.
- Use minimal base images (distroless or slim variants) to shrink the package list.
- Rebuild regularly even when your code has not changed, so inherited fixes reach production.
A useful mental model: your base image is a dependency you did not write, and you own every CVE inside it. The same logic applies to AI tooling that now sits in many pipelines. If you are evaluating agent-based automation, a good primer on where those systems touch your credentials is worth reading before you connect them.
Example 6: Secrets Left in Environment Variables
Another everyday example: database passwords and API tokens baked into environment variables or, worse, into image layers. Anyone who can run `docker history` or read a pod spec may see them. Kubernetes Secrets are base64-encoded by default, not encrypted, unless you enable encryption at rest.
Practical fixes that teams actually adopt:
| Mistake | Better practice |
|---|---|
| Secrets in Dockerfile `ENV` | Inject at runtime from a secret manager |
| Plain Kubernetes Secrets | Enable encryption at rest, restrict `get` on Secrets |
| Long-lived static tokens | Short-lived credentials via workload identity |
| Secrets in CI logs | Mask variables and audit log output |
The pattern across all these examples is the same: convenience defaults are rarely secure defaults.
Example 7: Container Escape via Host Mounts (CVE-2024-3177)
In 2024, Kubernetes patched CVE-2024-3177, which let users bypass the `mountPropagation: None` restriction and potentially reach the host filesystem. It joins a long line of escape examples that share one root cause: privileged containers and host mounts.
A container that runs with `privileged: true`, mounts `/var/run/docker.sock`, or mounts the host root is effectively a root shell on the node. Attackers know this. The defensive checklist is short and worth memorizing:
- Ban `privileged: true` with an admission policy.
- Never mount the Docker socket into application pods.
- Use read-only root filesystems where possible.
- Drop Linux capabilities and add back only what is needed.
- Run as non-root with a fixed UID.
These controls appear in the CIS Docker Benchmark, which remains one of the most concrete hardening references available.
Example 8: A Compromised GitOps Tool (Argo CD CVEs)
In 2022, Argo CD, a widely used GitOps tool, patched CVE-2022-31036 and related issues involving credential and secret exposure. GitOps tools are especially attractive targets because they hold cluster credentials and can deploy anything.
The lesson: your deployment tooling is part of your security perimeter. If an attacker controls the tool that applies manifests, they control the cluster. Teams now restrict who can merge to the deployment repository, require signed commits, and run the GitOps controller with the narrowest possible permissions.
Example 9: The Noisy Neighbor and Resource Exhaustion
Not every container security example involves an exploit. Denial of service through missing resource limits is common and cheap to fix. A single pod without CPU or memory limits can starve its neighbors or trigger node evictions. Kubernetes even shipped patches for a batch of denial-of-service issues in 2019 that became known informally as the “Billion Laughs” fixes.
Set requests and limits, use PodDisruptionBudgets, and test what happens when a node disappears. Resilience is a security property.
Building a Practical Defense Checklist
Across all these examples, a handful of controls keep showing up. Here is a checklist that reflects what actually works in production:
- Scan at every stage: source, build, registry, and runtime.
- Pin versions and digests, and rebuild on a schedule.
- Enforce least privilege in RBAC, capabilities, and service accounts.
- Block privileged containers and host mounts with admission policies.
- Encrypt and restrict secrets, and rotate them automatically.
- Isolate workloads with network policies and namespaces.
- Patch the runtime and orchestrator promptly, and watch vendor advisories.
- Log and alert on unusual process execution and API calls.
None of these are exotic. The failures above happened because one of them was skipped. Security teams that also manage endpoint and cloud accounts will recognize the pattern from guides on outdoor security cameras and smart locks: the basics, done consistently, beat clever one-off tools. Even personal finance habits echo the same discipline, as guides on Social Security timing and earnings show: small, repeated decisions compound. (Best internet security australia)
Conclusion
The container security examples above share a single thread: risk concentrates wherever convenience meets shared infrastructure. A runtime binary, a base image, an API server, or a GitOps controller can each become the one weak link that exposes everything. The organizations that avoid these failures are rarely the ones with the fanciest tools. They are the ones that pin versions, scan continuously, enforce least privilege, and treat every layer of the stack as something an attacker will eventually probe. Start with the checklist, pick the two controls you are missing, and fix them this week. That is how container security stops being a list of scary stories and becomes a habit.
Frequently Asked Questions
What is the most common container security vulnerability?
Missing resource limits, stale base images, and overly broad RBAC permissions top most lists. None require a clever exploit, which is exactly why they are so common.
Can a container escape affect the whole host?
Yes. Flaws like CVE-2019-5736 and the 2024 Leaky Vessels issues allowed attackers to break out of a container and reach the host. Privileged containers and host mounts make escape far easier, so both should be blocked by policy.
Are Kubernetes Secrets encrypted by default?
No. By default, Secrets are base64-encoded, not encrypted. Teams should enable encryption at rest and restrict who can read Secrets through RBAC.
How often should container images be scanned?
Continuously. Scan in CI, again in the registry, and at runtime, because new CVEs appear after images are built. Rebuilding images on a regular schedule is just as important as scanning them.
What is the difference between a container vulnerability and a misconfiguration?
A vulnerability is a flaw in software, such as a CVE in runc or OpenSSL. A misconfiguration is a bad setting, such as `privileged: true` or a public API server. Both cause breaches, but misconfigurations are usually cheaper and faster to fix.
Do I need a service mesh or specialized tool to secure containers?
Not necessarily. Pinned images, least-privilege RBAC, admission policies, and network policies cover most real-world risk. Specialized tools help at scale, but they cannot replace these fundamentals.


