Описание
BuildKit is a toolkit for converting source code to build artifacts in an efficient, expressive and repeatable manner. Two malicious build steps running in parallel sharing the same cache mounts with subpaths could cause a race condition that can lead to files from the host system being accessible to the build container. The issue has been fixed in v0.12.5. Workarounds include, avoiding using BuildKit frontend from an untrusted source or building an untrusted Dockerfile containing cache mounts with --mount=type=cache,source=... options.
A race condition issue was found in the Moby Builder Toolkit, stemming from a time-of-check/time-of-use (TOCTOU) vulnerability during cache volume mounting at container build time. Concurrent execution of two malicious build steps, sharing the same cache mounts with subpaths, may result in files from the host system being accessible to the build container. Successful exploitation could lead to a container escape to the underlying host OS when building an image using a malicious Dockerfile or upstream image (for example, when using FROM).
Отчет
This vulnerability can only be exploited when two containers are being built in parallel within the same cache directory. A concurrent running build that has the target cache directory mounted, needs to replace the target directory with a symbolic link between the time it is checked and actually used. As there is an unpredictable race condition, this issue is difficult to exploit. Therefore it is rated as having Moderate severity.
Меры по смягчению последствий
Do not use BuildKit frontends or Dockerfiles from untrusted sources.
Затронутые пакеты
| Платформа | Пакет | Состояние | Рекомендация | Релиз |
|---|---|---|---|---|
| OpenShift Developer Tools and Services | odo | Not affected | ||
| OpenShift Serverless | openshift-serverless-1/client-kn-rhel8 | Not affected | ||
| OpenShift Serverless | openshift-serverless-clients | Not affected | ||
| OpenShift Service Mesh 2 | openshift-service-mesh/istio-cni-rhel8 | Not affected | ||
| Red Hat Ansible Automation Platform 1.2 | openshift-clients | Not affected | ||
| Red Hat Ansible Automation Platform 2 | openshift-clients | Not affected | ||
| Red Hat Enterprise Linux 8 | container-tools:rhel8/buildah | Not affected | ||
| Red Hat Enterprise Linux 8 | container-tools:rhel8/podman | Not affected | ||
| Red Hat Enterprise Linux 9 | buildah | Not affected | ||
| Red Hat Enterprise Linux 9 | podman | Not affected |
Показывать по
Ссылки на источники
Дополнительная информация
Статус:
EPSS
7.5 High
CVSS3
Связанные уязвимости
BuildKit is a toolkit for converting source code to build artifacts in an efficient, expressive and repeatable manner. Two malicious build steps running in parallel sharing the same cache mounts with subpaths could cause a race condition that can lead to files from the host system being accessible to the build container. The issue has been fixed in v0.12.5. Workarounds include, avoiding using BuildKit frontend from an untrusted source or building an untrusted Dockerfile containing cache mounts with --mount=type=cache,source=... options.
BuildKit is a toolkit for converting source code to build artifacts in an efficient, expressive and repeatable manner. Two malicious build steps running in parallel sharing the same cache mounts with subpaths could cause a race condition that can lead to files from the host system being accessible to the build container. The issue has been fixed in v0.12.5. Workarounds include, avoiding using BuildKit frontend from an untrusted source or building an untrusted Dockerfile containing cache mounts with --mount=type=cache,source=... options.
BuildKit vulnerable to possible race condition with accessing subpaths from cache mounts
Уязвимость программного средства сборки контейнеров BuildKit, связанная с ошибками синхронизации при использовании общего ресурса («Ситуация гонки»), позволяющая нарушителю получить несанкционированный доступ к файлам с хост-системы для контейнера сборки
EPSS
7.5 High
CVSS3