Description

Threat actors are increasingly targeting Docker and Kubernetes environments by exploiting misconfigurations, exposed APIs, and weak isolation controls to gain access to hosts and cloud infrastructure. As the use of containerized applications expands, security gaps within these platforms have become high-value targets for attackers. A recent campaign attributed to the APT group TeamPCP showed this risk by compromising a Docker Hub repository used in a security scanning workflow. The malicious image contained credential-stealing code that activated during scans, enabling the collection of Kubernetes secrets and other sensitive data. This incident demonstrates the growing impact of software supply chain attacks and the risks of relying on compromised external resources. Although containers isolate applications using Linux namespaces and cgroups, they still share the host kernel, which introduces inherent security risks. If a container is compromised, attackers may exploit runtime or kernel flaws to escape isolation and access the underlying system. Known vulnerabilities such as CVE-2019-5736 in runC, which enabled host-level code execution, CVE-2022-0492 involving improper cgroup handling, and CVE-2024-21626 exposing host file systems through file descriptor issues highlight these weaknesses. In many situations, attackers do not even require vulnerabilities. Containers running in privileged mode or granted powerful Linux capabilities like CAP_SYS_ADMIN can directly interact with sensitive host components, increasing the risk of full system compromise. Misconfigured Docker and Kubernetes APIs are also widely abused. Exposed interfaces can allow attackers to deploy malicious workloads, execute commands, and extract sensitive data. When attackers obtain Kubernetes credentials or service tokens, they may misuse permissions to create privileged workloads capable of accessing host resources. Similarly, exposing the Docker socket inside a container can provide extensive control over the environment. To reduce exposure, organizations should enforce least-privilege access, secure APIs, monitor runtime behavior, protect CI/CD pipelines, and regularly audit container configurations.