containerd is an open source container runtime. On installations using SELinux, such as EL8 (CentOS, RHEL), Fedora, or SUSE MicroOS, with…
GitHub_M·CWE-281·Published 2022-01-05
containerd is an open source container runtime. On installations using SELinux, such as EL8 (CentOS, RHEL), Fedora, or SUSE MicroOS, with containerd since v1.5.0-beta.0 as the backing container runtime interface (CRI), an unprivileged pod scheduled to the node may bind mount, via hostPath volume, any privileged, regular file on disk for complete read/write access (sans delete). Such is achieved by placing the in-container location of the hostPath volume mount at either `/etc/hosts`, `/etc/hostname`, or `/etc/resolv.conf`. These locations are being relabeled indiscriminately to match the container process-label which effectively elevates permissions for savvy containers that would not normally be able to access privileged host files. This issue has been resolved in version 1.5.9. Users are advised to upgrade as soon as possible.
containerd is an open source container runtime. On installations using SELinux, such as EL8 (CentOS, RHEL), Fedora, or SUSE MicroOS, with containerd since v1.5.0-beta.0 as the backing container runtime interface (CRI), an unprivileged pod scheduled to the node may bind mount, via hostPath volume, any privileged, regular file on disk for complete read/write access (sans delete). Such is achieved by placing the in-container location of the hostPath volume mount at either `/etc/hosts`, `/etc/hostname`, or `/etc/resolv.conf`. These locations are being relabeled indiscriminately to match the container process-label which effectively elevates permissions for savvy containers that would not normally be able to access privileged host files. This issue has been resolved in version 1.5.9. Users are advised to upgrade as soon as possible.
Unprivileged pod using `hostPath` can side-step active LSM when it is SELinux in github.com/containerd/containerd
### Impact Containers launched through containerd’s CRI implementation on Linux systems which use the SELinux security module and containerd versions since v1.5.0 can cause arbitrary files and directories on the host to be relabeled to match the container process label through the use of specially-configured bind mounts in a hostPath volume. This relabeling elevates permissions for the container, granting full read/write access over the affected files and directories. Kubernetes and crictl can both be configured to use containerd’s CRI implementation. If you are not using containerd’s CRI implementation (through one of the mechanisms described above), you are not affected by this issue. ### Patches This bug has been fixed in containerd 1.5.9. Because file labels persist independently of containerd, users should both update to these versions as soon as they are released and validate that all files on their host are correctly labeled. ### Workarounds Ensure that no sensitive files or directories are used as a hostPath volume source location. Policy enforcement mechanisms such a Kubernetes Pod Security Policy [AllowedHostPaths](https://kubernetes.io/docs/concepts/policy/pod-security-policy/#volumes-and-file-systems) may be specified to limit the files and directories that can be bind-mounted to containers. ### For more information If you have any questions or comments about this advisory: * Open an issue in [containerd](https://github.com/containerd/containerd/issues/new/choose) * Email us at [security@containerd.io](mailto:security@containerd.io)
containerd es un tiempo de ejecución de contenedores de código abierto. En las instalaciones que usan SELinux, como EL8 (CentOS, RHEL), Fedora o SUSE MicroOS, con containerd desde la versión v1.5.0-beta.0 como interfaz de ejecución de contenedores de respaldo (CRI), un pod sin privilegios programado en el nodo puede enlazar el montaje, por medio del volumen hostPath, de cualquier archivo privilegiado y regular en el disco para un acceso completo de lectura/escritura (sans delete). Esto es conseguido al colocar la ubicación dentro del contenedor del montaje del volumen hostPath en "/etc/hosts", "/etc/hostname", o "/etc/resolv.conf". Estas ubicaciones están siendo reetiquetadas indiscriminadamente para que coincidan con la etiqueta del proceso del contenedor, lo que efectivamente eleva los permisos para los contenedores inteligentes que normalmente no podrían acceder a los archivos privilegiados del host. Este problema ha sido resuelto en versión 1.5.9. Se recomienda a usuarios que actualicen lo antes posible.
| Version | Type | Source | Base | Exp | Impact | Vector |
|---|---|---|---|---|---|---|
| 2.0 | Primary | NVD | 6.0 | 6.8 | 6.4 | AV:N/AC:M/Au:S/C:P/I:P/A:P |
| 3.1 | Primary | NVD | 9.1 | 2.3 | 6.0 | CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H |
| 3.1 | Primary | cve.org | 8.0 | — | — | CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:C/C:H/I:H/A:H |
| 3.1 | Primary | cve.org | 8.0 | — | — | CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:C/C:H/I:H/A:H |
| 3.1 | Secondary | NVD | 8.0 | 1.3 | 6.0 | CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:C/C:H/I:H/A:H |
| 3.1 | Secondary | GHSA | 8.0 | — | — | CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:C/C:H/I:H/A:H |