/

CVE-2026-105769

Severity:

CRITICAL RISK

(9.3)

Origin Validation Failure (CWE-346) in kaniko Builds

CVE-2026-105769

Awaiting Analysis

Vulnerability type

Category:

Improper Hostname Validation and Credential Disclosure

CWE:

CWE-346, CWE-522

Impact:

Cloud Access Token Disclosure

Severity:

CRITICAL RISK

(9.3)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

kaniko may send an Azure access token to an attacker-controlled registry host when a build processes an image reference using a lookalike Azure Container Registry hostname. If an attacker can influence a Dockerfile or other build input, the exposed token could be used to access Azure resources permitted by the build identity.

kaniko may send an Azure access token to an attacker-controlled registry host when a build processes an image reference using a lookalike Azure Container Registry hostname. If an attacker can influence a Dockerfile or other build input, the exposed token could be used to access Azure resources permitted by the build identity.

Affected context

The issue occurs in kaniko builds that use the Azure Container Registry credential helper. The helper's hostname check can accept a host containing an Azure Container Registry domain substring even when that host is not an actual ACR registry. Risk depends on whether a build processes an attacker-influenced image reference and has access to an Azure identity, such as a service principal, federated workload identity, or managed identity.

The issue occurs in kaniko builds that use the Azure Container Registry credential helper. The helper's hostname check can accept a host containing an Azure Container Registry domain substring even when that host is not an actual ACR registry. Risk depends on whether a build processes an attacker-influenced image reference and has access to an Azure identity, such as a service principal, federated workload identity, or managed identity.

Exploit preconditions

  • Attack surface: kaniko image references in Dockerfiles or related build inputs, including FROM and COPY --from
  • Required access: Ability to influence a Dockerfile or other image reference processed by a build; the build must have access to an Azure identity
  • Trigger point: The credential helper is consulted for an image reference whose host has no configured Docker credentials and is not handled by the Google or Amazon ECR helpers
  • Why exploitation is possible: An unanchored hostname regular expression can treat a lookalike host as an ACR registry, prompting the helper to obtain an Azure token and send it to that host before registry contact
  • Attack surface: kaniko image references in Dockerfiles or related build inputs, including FROM and COPY --from
  • Required access: Ability to influence a Dockerfile or other image reference processed by a build; the build must have access to an Azure identity
  • Trigger point: The credential helper is consulted for an image reference whose host has no configured Docker credentials and is not handled by the Google or Amazon ECR helpers
  • Why exploitation is possible: An unanchored hostname regular expression can treat a lookalike host as an ACR registry, prompting the helper to obtain an Azure token and send it to that host before registry contact

Why this happens

The credential helper identifies ACR hosts using an unanchored regular expression, so a hostname can match an ACR domain substring without being an actual ACR host. The helper then obtains a token from the build's Azure identity and sends it to the selected host. This is an origin or domain validation failure (CWE-346) that can expose sensitive authentication credentials (CWE-522).

The credential helper identifies ACR hosts using an unanchored regular expression, so a hostname can match an ACR domain substring without being an actual ACR host. The helper then obtains a token from the build's Azure identity and sends it to the selected host. This is an origin or domain validation failure (CWE-346) that can expose sensitive authentication credentials (CWE-522).

Potential impact

  • An attacker could use a disclosed token to access Azure Resource Manager within the permissions assigned to the build identity until the token expires.
  • An attacker could potentially exchange the token for credentials to ACR registries accessible to that identity.
  • Azure resources or container images could be exposed or modified, depending on the identity's permissions.
  • Build and supply-chain integrity could be affected if an attacker can influence image references or access writable resources.
  • An attacker could use a disclosed token to access Azure Resource Manager within the permissions assigned to the build identity until the token expires.
  • An attacker could potentially exchange the token for credentials to ACR registries accessible to that identity.
  • Azure resources or container images could be exposed or modified, depending on the identity's permissions.
  • Build and supply-chain integrity could be affected if an attacker can influence image references or access writable resources.

General mitigation guidance

Defensive patterns include:

  • Validate registry hosts using exact, canonical hostname matching and an explicit allowlist rather than substring or unanchored pattern checks.
  • Avoid sending cloud identity tokens to hosts that have not been independently verified as trusted registries.
  • Reduce trust in externally supplied Dockerfiles and image references through review and controlled build inputs.
  • Limit build identities to the minimum permissions and registry scope required; use short-lived credentials where practical.
  • Keep sensitive identity material isolated from builds that process untrusted inputs, and apply network egress controls where appropriate.

Defensive patterns include:

  • Validate registry hosts using exact, canonical hostname matching and an explicit allowlist rather than substring or unanchored pattern checks.
  • Avoid sending cloud identity tokens to hosts that have not been independently verified as trusted registries.
  • Reduce trust in externally supplied Dockerfiles and image references through review and controlled build inputs.
  • Limit build identities to the minimum permissions and registry scope required; use short-lived credentials where practical.
  • Keep sensitive identity material isolated from builds that process untrusted inputs, and apply network egress controls where appropriate.

How teams detect issues like this

  • Use static analysis to flag unanchored hostname regular expressions and credential helpers that select cloud credentials based on partial host matches.
  • Review build paths that retrieve identity tokens before validating registry destinations, including handling of FROM and COPY --from references.
  • Monitor build and network logs for token exchange requests to unexpected registry hosts or domains resembling trusted registries.
  • Enforce policy checks that restrict image references to approved, canonical registry hostnames and limit build identity permissions.
  • Automated code review tools can help identify risky hostname validation and credential handling patterns.
  • Use static analysis to flag unanchored hostname regular expressions and credential helpers that select cloud credentials based on partial host matches.
  • Review build paths that retrieve identity tokens before validating registry destinations, including handling of FROM and COPY --from references.
  • Monitor build and network logs for token exchange requests to unexpected registry hosts or domains resembling trusted registries.
  • Enforce policy checks that restrict image references to approved, canonical registry hostnames and limit build identity permissions.
  • Automated code review tools can help identify risky hostname validation and credential handling patterns.

Sources

SourceLink
github.comgithub.com/chainguard-forks/kaniko/pull/495
github.comgithub.com/chainguard-forks/kaniko/releases/tag/v1.25.20
github.comgithub.com/chainguard-forks/kaniko/security/advisories/GHSA-5q7h-w9jf-cx97
github.comgithub.com/chrismellard/docker-credential-acr-env/issues/21
pkg.go.devpkg.go.dev/vuln/GO-2026-6225

Frequently asked

questions

Exploitation can occur during a build if an attacker can influence an image reference that kaniko processes. The build must also have access to an Azure identity for a token to be exposed.

Not necessarily. The key requirement is the ability to influence a Dockerfile or related build input; the build environment supplies the identity and makes the token request.

Validate registry destinations with exact host matching against an explicit allowlist, and do not send identity tokens to unverified hosts.

Treat build inputs as untrusted, restrict cloud identity permissions, and combine code review and static analysis for hostname validation with policy enforcement on allowed registries.

Exploitation can occur during a build if an attacker can influence an image reference that kaniko processes. The build must also have access to an Azure identity for a token to be exposed.

Not necessarily. The key requirement is the ability to influence a Dockerfile or related build input; the build environment supplies the identity and makes the token request.

Validate registry destinations with exact host matching against an explicit allowlist, and do not send identity tokens to unverified hosts.

Treat build inputs as untrusted, restrict cloud identity permissions, and combine code review and static analysis for hostname validation with policy enforcement on allowed registries.

Find out what's already
exploitable in your codebase.