CVE-2026-105769: Stop kaniko From Leaking Azure Tokens

kaniko container build validating an ACR hostname before releasing an Azure access token

Security brief: CVE-2026-105769 can make a vulnerable kaniko build send a live Microsoft Entra ID access token to an attacker-controlled registry whose hostname only looks like Azure Container Registry. Teams should patch to kaniko 1.25.20 or later, isolate untrusted builds from Azure identities, and investigate tokens issued during exposed build windows.

Chainguard published the vendor advisory on November 2, 2026, and GitHub added the reviewed advisory on November 5. The flaw sits in the Azure Container Registry credential helper used by kaniko before version 1.25.20. It matters because a malicious or compromised Dockerfile needs only a crafted image reference. It does not need a RUN instruction, and the build does not need to push an image.

The vendor rates the issue critical. Exposure requires three conditions: a vulnerable kaniko version, build input that is not fully trusted, and an Azure identity that the helper can reach. That identity may come from service-principal environment variables, AKS workload identity, a managed identity through Azure Instance Metadata Service, or a configured MSI endpoint.

Why a lookalike ACR hostname can capture a token

The vulnerable helper decided whether a registry was Azure Container Registry by applying an unanchored regular expression. A hostname containing a valid Azure registry suffix anywhere in its name could pass the check, even when the real registrable domain belonged to an attacker.

For example, a reference shaped like team.azurecr.io.evil.invalid/image contains .azurecr.io, but it is not an ACR host. Before the fix, the helper could treat it as one. The advisory states that kaniko consults the built-in helper for registry references without Docker-config credentials when they are not Google or Amazon ECR registries. This includes base images in FROM and external images in COPY --from=....

The credential request happens before registry contact

The attacker’s registry does not have to challenge the build for authentication. The helper first obtains an Azure Resource Manager token and posts it to the registry host’s /oauth2/exchange endpoint. The token appears in both a bearer header and an access_token form field, so the destination receives the live credential.

Until the token expires, an attacker can exercise the Azure role assignments granted to that identity. The advisory also explains that the token may be exchanged at a legitimate ACR that the identity can access. An identity with AcrPush or broader rights could allow image publication, turning a build-time credential leak into a software supply-chain incident.

Exposure matrix

ConditionWhy it mattersPriority
kaniko earlier than 1.25.20Contains the vulnerable ACR helper pathPatch or rebuild immediately
Untrusted Dockerfile or build argumentCan introduce a deceptive registry host in FROM or COPY --fromReview build provenance
Azure identity reachableProvides a service-principal, workload or managed-identity tokenContain the token path
Global credsStore: acr-envInvokes the standalone helper for every registryReplace with per-host helpers
Version 1.25.20 or laterUses an anchored, label-aware host checkVerify the exact built artifact

You do not need to use ACR intentionally to be exposed. The built-in helper is enough when the other conditions exist. Conversely, finding an old kaniko image is not proof of token disclosure. Analysts must establish whether untrusted build input and an Azure identity were present at the same time.

Inventory vulnerable builders

Start with the image actually running in the cluster, not only the deployment manifest in source control. Record the repository, tag, resolved digest, namespace and workload owner.

kubectl get pods -A -o json | jq -r '
  .items[] as $pod
  | $pod.spec.containers[]?
  | select(.image | ascii_downcase | contains("kaniko"))
  | [$pod.metadata.namespace, $pod.metadata.name, .name, .image]
  | @tsv'

# Resolve the image IDs reported by the runtime.
kubectl get pods -A -o json | jq -r '
  .items[] as $pod
  | $pod.status.containerStatuses[]?
  | select(.image | ascii_downcase | contains("kaniko"))
  | [$pod.metadata.namespace, $pod.metadata.name, .image, .imageID]
  | @tsv'

The Chainguard fork’s repository does not publish ready-made images or binaries for this fix. The advisory instructs users to rebuild the executor, warmer and standalone docker-credential-acr-env from version 1.25.20 or later. If your organization consumes a third-party image, verify its source commit, module version and digest rather than trusting a mutable tag.

Identify Azure identity paths without dumping secrets

# Print only environment-variable names, never their values.
kubectl get pods -A -o json | jq -r '
  .items[] as $pod
  | $pod.spec.containers[]?
  | select(.image | ascii_downcase | contains("kaniko"))
  | (.env // [])[]?
  | select(.name | test("^(AZURE_|MSI_)"))
  | [$pod.metadata.namespace, $pod.metadata.name, .name]
  | @tsv'

# List service accounts used by kaniko workloads for workload-identity review.
kubectl get pods -A -o json | jq -r '
  .items[]
  | select(any(.spec.containers[]?; .image | ascii_downcase | contains("kaniko")))
  | [.metadata.namespace, .metadata.name, .spec.serviceAccountName]
  | @tsv'

Then inspect the referenced service accounts, federated identity credentials, pod labels and network policies. Microsoft documents that AKS Workload Identity uses projected service-account tokens and OIDC federation to let workloads access Entra-protected resources. That makes service-account binding part of the exposure analysis, not merely Kubernetes metadata.

Patch, contain and recover

Upgrade to 1.25.20 or later

The fixed release carries a patched copy of the credential helper inside the kaniko module. It accepts only an exact host[:port] value for mcr.microsoft.com or a well-formed hostname ending in an approved Azure registry suffix. Other hosts return a credentials-not-found result without requesting a token.

# Source consumers can verify the module version.
go list -m github.com/chainguard-dev/kaniko

# Inspect a built executor for the vulnerable helper module.
govulncheck -mode=binary /path/to/kaniko-executor

# Record a rebuilt image by immutable digest.
crane digest registry.internal.example/build/kaniko:v1.25.20

Use your organization’s approved scanner and provenance workflow. The command paths above are examples; do not pull or execute an unknown binary merely to inspect it. After deployment, restart builder workloads and confirm every running pod resolves to the approved digest.

Contain builds that cannot be patched immediately

  • Remove service-principal secrets, federated token files, MSI_ENDPOINT and MSI_SECRET from untrusted build environments.
  • Block build-pod access to Azure Instance Metadata Service at 169.254.169.254.
  • If built-in ACR authentication is not needed, set AZURE_ENVIRONMENT=none so the helper fails before requesting a token.
  • Replace a global credsStore: acr-env with explicit per-host credHelpers entries for approved ACR registries.
  • Restrict Dockerfile and build-argument changes to reviewed sources and protected branches.

These are temporary controls. The vendor notes that changing the global credential-store configuration closes only the standalone-helper path. The built-in helper remains relevant until the kaniko artifact itself is fixed.

Treat exposed tokens as compromised

If untrusted builds ran while an Azure identity was reachable, define the exposure window from the first vulnerable build through containment. Rotating a service-principal secret does not revoke an access token that has already been issued. Preserve the build logs and wait for the token lifetime to end while reducing or disabling the identity’s permissions where operationally safe.

  • Review Entra service-principal and managed-identity sign-in logs for the affected identity.
  • Review Azure Activity logs for ACR pushes, role-assignment changes and key or secret listing operations.
  • Inspect ACR repositories for unexpected manifests, tags and digests created during or after suspect builds.
  • Rotate downstream secrets that the identity could read through Azure Resource Manager, including relevant storage keys or application secrets.
  • Rebuild downstream images from known-good source if registry integrity cannot be established.

Microsoft’s sign-in logs distinguish service-principal and managed-identity activity and identify the actor, client and target resource. Pair that identity evidence with build timestamps and registry audit data. For broader Azure hardening context, see our Azure security best-practices guide. For short-lived CI credentials and controlled federation, review our OIDC trusted-publishing workflow.

Detection opportunities

  • DNS or proxy events for registry hosts that contain .azurecr.io, .azurecr.cn, .azurecr.de or .azurecr.us but do not end at that suffix.
  • Outbound POST requests from build workloads to an unexpected /oauth2/exchange endpoint.
  • Azure Resource Manager activity from a builder identity outside expected build regions, networks or time windows.
  • New ACR tags or manifests not linked to an approved pipeline run and source commit.
  • Role assignments, key listings or secret reads performed by an identity normally limited to image pulls.
  • Dockerfile changes that introduce external hosts in FROM or COPY --from.

A hostname match is a triage signal, not proof of compromise. Validate the parsed host, resolved domain, build source and identity context before escalating. Preserve raw logs because normalized fields may hide the exact hostname that triggered the helper.

Hands-on lab: classify kaniko exposure safely

This offline lab uses synthetic inventory only. It does not start kaniko, request a token, contact Azure or connect to any registry.

Prerequisites

  • Python 3.10 or later.
  • An empty local directory with no production secrets.
  • No network access.
mkdir -p kaniko-azure-triage
cd kaniko-azure-triage

cat > inventory.csv <<'CSV'
builder,version,untrusted_input,azure_identity,imds_access,registry_host
pr-builder,1.25.19,true,workload,true,team.azurecr.io.evil.invalid
release-builder,1.25.19,false,service-principal,false,team.azurecr.io
isolated-builder,1.25.18,true,none,false,mirror.internal.example
patched-builder,1.25.20,true,workload,true,team.azurecr.io.evil.invalid
CSV

Save the next block as classify.py.

import csv

AZURE_SUFFIXES = (".azurecr.io", ".azurecr.cn", ".azurecr.de", ".azurecr.us")

def version_tuple(value):
    return tuple(int(part) for part in value.split(".")[:3])

def yes(value):
    return value.strip().lower() == "true"

def suspicious_host(host):
    host = host.lower().split(":", 1)[0].rstrip(".")
    contains = any(suffix in host for suffix in AZURE_SUFFIXES)
    valid_acr = any(host.endswith(suffix) and host != suffix[1:] for suffix in AZURE_SUFFIXES)
    return contains and not valid_acr

with open("inventory.csv", newline="", encoding="utf-8") as handle:
    for row in csv.DictReader(handle):
        vulnerable = version_tuple(row["version"]) < (1, 25, 20)
        identity_path = row["azure_identity"] != "none" or yes(row["imds_access"])
        untrusted = yes(row["untrusted_input"])
        lookalike = suspicious_host(row["registry_host"])

        if vulnerable and untrusted and identity_path and lookalike:
            status = "PATCH_INVESTIGATE_TOKEN_WINDOW"
        elif vulnerable and identity_path:
            status = "PATCH_REVIEW_BUILD_PROVENANCE"
        elif vulnerable:
            status = "PATCH_CONFIRM_IDENTITY_ISOLATION"
        else:
            status = "PATCHED_VERIFY_DIGEST_AND_POLICY"

        print(f'{row["builder"]}: {status}')

Run the classifier:

python3 classify.py

Expected output:

pr-builder: PATCH_INVESTIGATE_TOKEN_WINDOW
release-builder: PATCH_REVIEW_BUILD_PROVENANCE
isolated-builder: PATCH_CONFIRM_IDENTITY_ISOLATION
patched-builder: PATCHED_VERIFY_DIGEST_AND_POLICY

The classifier intentionally treats a patched builder as a separate verification case. Version compliance does not prove that the running image came from the expected source or that policy prevents deceptive registry names.

Troubleshooting and cleanup

  • If parsing fails, confirm the CSV header and six fields per row are unchanged.
  • If a real tag includes a prefix such as v1.25.20, normalize it before using this minimal lab parser.
  • If an image is referenced by digest only, map the digest to its kaniko source version using your software bill of materials and provenance records.
cd ..
rm -r kaniko-azure-triage

Conclusion

CVE-2026-105769 turns a registry-host validation mistake into an Azure identity problem. The most important operational detail is that the credential helper can request and send the token before the build contacts the registry. Traditional controls that wait for an authentication challenge may therefore miss the event.

Patch kaniko to 1.25.20 or later, verify the exact rebuilt artifact, separate untrusted builds from Azure identities, and review every exposed identity through the full token lifetime. Add hostname-aware egress detection and immutable build provenance so future registry confusion cannot quietly cross the boundary between source input and cloud control-plane access.

Primary references

Similar Posts