GHSA-vp35-85q5-9f25: Container build can leak any path on the host into the container
Оценка Noroxi
Приоритет: Наблюдать (оценка срочности 0/100)
- В отслеживаемых источниках (CISA KEV, Exploit-DB, Metasploit, Nuclei, GitHub) нет публичного эксплойта или записей об эксплуатации.
- Исправленная версия: github.com/docker/docker (Go) 20.10.20, 20.10.20+incompatible.
Пока низкий приоритет. Обновитесь до github.com/docker/docker (Go) 20.10.20, 20.10.20+incompatible или новее.
Формируется автоматически по данным записи: CVSS (NVD и CNA), CISA KEV и SSVC, FIRST EPSS, источники эксплойтов, исправленные версии. Как мы считаем
Первоисточники: OSV
### Description Moby is the open source Linux container runtime and set of components used to build a variety of downstream container runtimes, including Docker CE, Mirantis Container Runtime (formerly Docker EE), and Docker Desktop. Moby allows for building container images using a set of build instructions (usually named and referred to as a "Dockerfile"), and a build context, which is not unlike the CWD in which the Dockerfile instructions are executed. Containers may be built using a variety of tools and build backends available in the Moby ecosystem; in all cases, builds may not include files outside of the build context (such as using absolute or relative-parent paths). This is enforced through both checks in the build backends, and the containerization of the build process itself. Versions of Git where CVE-2022-39253 is present and exploited by a malicious repository, when used in combination with Moby, are subject to an unexpected inclusion of arbitrary filesystem paths in the build context, without any visible warning to the user. This issue was originally reported by Wenxiang Qian of Tencent Blade Team, and the root-cause analysis was performed by Cory Snider of Mirantis, with assistance from Bjorn Neergaard of the same. The issue was then reported to the Git project, and Taylor Blau led the process resolving the root issue in Git. ### Impact This vulnerability originates in Git, but can be used to violate assumptions that may have security implications for users of Moby and related components. Users may rely on the fact that a build context ensures that outside files cannot be referenced or incorporated using multiple enforcement mechanisms, or expect a warning if this does not hold true. A maliciously crafted Git repository exploiting CVE-2022-39253 can violate this assumption, and potentially include sensitive files that are subsequently uploaded to a container image repository, or disclosed by code inside the resulting container image. As this issue cannot be triggered remotely, except by users who already have full control over the daemon through the API, and it requires exploiting a vulnerability in Git by convincing a user to build a maliciously crafted repository, the impact in Moby is considered low. ### Patches Moby 20.10.20, and Mirantis Container Runtime (formerly Docker Enterprise Edition) 20.10.14 will contain mitigations for CVE-2022-39253 when a Git clone is performed by Moby components (on either the daemon or API client side). However, as these mitigations only apply to certain scenarios (build of `git+<protocol>://...` URL contexts) and cannot protect against a malicious repository already on disk, users should update to a version of Git containing patches for CVE-2022-39253 on all their systems running both API clients and daemons. Specifically, patches in Moby (including patches incorporated from BuildKit) protect against the following: * `docker build` with the legacy builder (e.g. `DOCKER_BUILDKIT` unset or set to 0) of a Git URL context. Note that depending on available API versions and the CLI version, the Git clone operation can take place on either the client or the daemon side. Both must be updated (or have Git updated) to fully protect this build method. * `docker build` with the BuildKit builder (e.g. `DOCKER_BUILDKIT=1`) of a Git URL context. * `docker buildx build` with `BUILDKIT_CONTEXT_KEEP_GIT_DIR=1` of a Git URL context. Patches in BuildKit incorporated into Docker Compose protect against CVE-2022-39253 during Compose-driven builds of Git URL contexts. Patches in Moby and related projects such as BuildKit, the Docker CLI, and Docker Compose **cannot** fully protect against CVE-2022-39253, as it may be triggered by a malicious repository already on disk that a unpatched Git client has interacted with (specifically, commands that check out submodules such as `git clone --recursive`, `git submodule update`, etc. may have already triggered the Git vulnerability). ### Workarounds While this behavior is unexpected and undesirable, and has resulted in this security advisory, users should keep in mind that building a container entails arbitrary code execution. Users should not build a repository/build context they do not trust, as containerization cannot protect against all possible attacks. When building with BuildKit (e.g. `docker buildx build` or `docker build` with `DOCKER_BUILDKIT=1`), this issue cannot be exploited unless `--build-arg BUILDKIT_CONTEXT_KEEP_GIT_DIR=1` was also passed, as by default BuildKit will discard the `.git` directory of a Git URL context immediately after cloning and checking out the repository. ### For more information If you have any questions or comments about this advisory: * [Open an issue](https://github.com/moby/moby/issues/new) * Email us at [security@docker.com](mailto:security@docker.com)
- Опубликовано
- 11 нояб. 2022 г.
- Обновлено
- 21 авг. 2024 г.
- EPSS
- —
- CWE
- CWE-200
Инструменты для отчёта
Оценка срочности
0
Пока низкий приоритет.
- CVSS
- 0 / 40 · —
- CISA KEV
- 0 / 30 · Нет в списке
- EPSS
- 0 / 30 · —
Узнайте, когда запись изменится
- Нет в KEV: эксплуатация в реальных атаках не зафиксирована
- Публичного эксплойта нет
- Исправление выпущено
Если что-то из этого изменится, сообщим в ежедневной сводке.
Затронута ли ваша версия? ПроверьтеАнализ Noroxi
Что это значит для вашей инфраструктуры?
Оценка выше формируется автоматически по данным записи и не знает вашей среды. Наша команда проверит на ваших системах, действительно ли уязвимость эксплуатируема и какой меры достаточно.
Мы используем этот продукт, нужна помощьЗатронутые системы
Затронута ли ваша версия?
Выберите продукт и введите свою версию. Она сравнивается с диапазонами этой записи прямо в браузере и никуда не отправляется.
| Вендор | Продукт | CPE |
|---|---|---|
| Go | github.com/docker/docker | pkg:golang/github.com/docker/docker |
Затронутые пакеты
Данные OSV и GitHub Advisory: экосистема, пакет и диапазон. Сопоставление SBOM использует эту таблицу.
| Экосистема | Пакет | Затронутый диапазон | Исправление |
|---|---|---|---|
| Go | github.com/docker/docker | до 20.10.20 | 20.10.20 |
| Go | github.com/docker/docker | до 20.10.20+incompatible | 20.10.20+incompatible |
Тот же продукт
Go: все записиДругие записи с наивысшей оценкой для того же основного продукта.
- GO-2022-1107Container build can leak any path on the host into the container in github.com/docker/docker0Наблюдать
- GO-2024-2914Moby (Docker Engine) is vulnerable to Ambiguous OCI manifest parsing in github.com/docker/docker0Наблюдать
- GHSA-xmmx-7jpf-fx42Moby (Docker Engine) is vulnerable to Ambiguous OCI manifest parsing0Наблюдать
Опубликованы до и после этой записи в том же продукте
- Позже →GHSA-jq35-85cj-fj4p30 окт. 2023 г. · /sys/devices/virtual/powercap accessible by default to containers0Наблюдать
Исправление
На какую версию обновиться
Версии с исправлением по данным вендора, реестров пакетов и Microsoft. Перед обновлением сверьтесь с бюллетенем вендора.
| Продукт / пакет | Исправленная версия | Источник |
|---|---|---|
| Go:github.com/docker/docker | 20.10.20 | Реестр пакетов (OSV) |
| Go:github.com/docker/docker | 20.10.20+incompatible | Реестр пакетов (OSV) |
Статус эксплойта
Публичный эксплойт неизвестен
Публичный эксплойт пока не обнаружен. Это не значит, что вы в безопасности, лишь что порог чуть выше.
Контекст для исследователя
Для пентестеров и исследователей: профиль атаки, расхождение оценок, хронология, коммиты исправлений, авторы, кандидаты в варианты и цепочки, охват bug bounty. Всё выводится из имеющихся данных; без кода эксплойтов.
Хронология
От публикации до сегодня: proof of concept, модуль Metasploit, CISA KEV и запись об исправлении. Даты — как сообщают источники.
Кроме публикации датированных событий нет.
В записи нет: истории EPSS · ссылки на коммит или PR с исправлением · указания авторов находки · кандидатов в варианты и цепочки · публичной программы вознаграждений.
Технические детали
Для этой записи нет вектора CVSS, условия атаки вывести нельзя.
Класс уязвимости (CWE)
CWE-200 · Exposure of Sensitive Information to an Unauthorized ActorПервопричина
Расширение запрашивает более широкие разрешения, чем требуется для его функции, и отправляет собранные данные вовне для целей, не связанных с его назначением.
Ошибка в коде
Весь класс CWE-200Показательный пример этого класса уязвимостей. Это не исходный код вендора; показан ошибочный шаблон и его исправление.
Уязвимый код
{
"permissions": ["tabs", "<all_urls>"],
"background": { "service_worker": "analytics.js" }
}Исправленный код
{
"permissions": ["activeTab"],
"host_permissions": ["https://yildiz.example/*"]
}Контекст атаки
Шаблоны атак MITRE CAPEC и техники ATT&CK для этого класса уязвимости (CWE). Отправная точка для правил обнаружения и threat hunting.
Шаблоны атак (CAPEC)
- ExcavationCAPEC-116вероятность: High · Medium
- Subverting Environment Variable ValuesCAPEC-13вероятность: High · Very High
- FootprintingCAPEC-169вероятность: High · Very Low
- Exploiting Trust in ClientCAPEC-22вероятность: High · High
- FingerprintingCAPEC-224вероятность: High · Very Low
- ICMP Echo Request PingCAPEC-285вероятность: Medium · Low
- TCP SYN ScanCAPEC-287Low
- Enumerate Mail Exchange (MX) RecordsCAPEC-290Low
Техники ATT&CK
- System Service DiscoveryT1007
- System Network Configuration DiscoveryT1016
- Remote System DiscoveryT1018
- System Owner/User DiscoveryT1033
- Masquerading: Match Legitimate Name or LocationT1036.005
- Network Service ScanningT1046
- System Network Connections DiscoveryT1049
- Process DiscoveryT1057
- Permission Groups DiscoveryT1069
- System Information DiscoveryT1082
- File and Directory DiscoveryT1083
- Account DiscoveryT1087
- Multi-Factor Authentication InterceptionT1111
- Peripheral Device DiscoveryT1120
- System Time DiscoveryT1124
- Access Token Manipulation:Token Impersonation/TheftT1134.001
Журнал изменений (2)
- Исправление✗ → ✓
- CVSS2.5 → —
Для отслеживаемых записей эти изменения приходят и как уведомления. →
Источники
Показать все источники (ещё 4)Свернуть
Рекомендации вендоров и официальные записи. Ссылки на эксплойты/PoC намеренно исключены.