CVE-2026-28406
JSON

8.2high

kaniko has tar archive path traversal in build context extraction allows writing files outside destination directory

Severity
8.2high CVSS:3.1 by GitHub_M
Exploit likelihood
0.67% (higher than 53% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-6rxq-q92g-4rmfGO-2026-4580

Description

kaniko is a tool to build container images from a Dockerfile, inside a container or Kubernetes cluster. Starting in version 1.25.4 and prior to version 1.25.10, kaniko unpacks build context archives using `filepath.Join(dest, cleanedName)` without enforcing that the final path stays within `dest`. A tar entry like `../outside.txt` escapes the extraction root and writes files outside the destination directory. In environments with registry authentication, this can be chained with docker credential helpers to achieve code execution within the executor process. Version 1.25.10 uses securejoin for path resolution in tar extraction.

Affected

Product or packageVersionsReported by
chainguard-forks kaniko>= 1.25.4, < 1.25.10CVE List
openshift-serverless-1/kn-client-kn-rhel9Not specifiedCVE List
openshift-serverless-1/kn-plugin-func-func-util-rhel9Not specifiedCVE List
openshift-serverless-clientsNot specifiedCVE List
github.com/chainguard-dev/kaniko (Go)from 1.25.4 before 1.25.10GitHub Advisory Database, Go Vulnerability Database
chainguard kanikofrom 1.25.4 before 1.25.10NVD

All scores

GitHub_M8.2high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:L
redhat-SADP8.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:N/I:H/A:L
GitHub8.2high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:L

Classification

CWE-22

SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial.

What each source says

CVE List

kaniko is a tool to build container images from a Dockerfile, inside a container or Kubernetes cluster. Starting in version 1.25.4 and prior to version 1.25.10, kaniko unpacks build context archives using `filepath.Join(dest, cleanedName)` without enforcing that the final path stays within `dest`. A tar entry like `../outside.txt` escapes the extraction root and writes files outside the destination directory. In environments with registry authentication, this can be chained with docker credential helpers to achieve code execution within the executor process. Version 1.25.10 uses securejoin for path resolution in tar extraction.

GitHub Advisory Database

kaniko unpacks build context archives using filepath.Join(dest, cleanedName) without enforcing that the final path stays within dest. A tar entry like ../outside.txt escapes the extraction root and writes files outside the destination directory. In environments with registry authentication, this can be chained with docker credential helpers to achieve code execution within the executor process. Affected versions >= 1.25.4, <= 1.25.9.

Fix: Merged with PR #326 — uses securejoin for path resolution in tar extraction.

Acknowledgements

kaniko thanks Oleh Konko from 1seal for discovering and reporting this issue.

Go Vulnerability Database

kaniko has tar archive path traversal in its build context extraction, allowing file writes outside destination directories in github.com/chainguard-dev/kaniko

NVD (es)

kaniko es una herramienta para construir imágenes de contenedores a partir de un Dockerfile, dentro de un contenedor o un clúster de Kubernetes. A partir de la versión 1.25.4 y antes de la versión 1.25.10, kaniko descomprime archivos de contexto de construcción usando 'filepath.Join(dest, cleanedName)' sin asegurar que la ruta final permanezca dentro de 'dest'. Una entrada tar como '../outside.txt' escapa la raíz de extracción y escribe archivos fuera del directorio de destino. En entornos con autenticación de registro, esto puede encadenarse con los ayudantes de credenciales de docker para lograr la ejecución de código dentro del proceso del ejecutor. La versión 1.25.10 utiliza securejoin para la resolución de rutas en la extracción de tar.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-28406 changed 2026-07-15CVE Terms of Use
GitHub Advisory DatabaseGHSA-6rxq-q92g-4rmf changed 2026-03-23CC-BY-4.0
Go Vulnerability DatabaseGO-2026-4580 changed 2026-03-23CC-BY-4.0
NVDCVE-2026-28406 changed 2026-07-15Public domain