Description (CNA)
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 (CNA)
| Vendor / product | Versions |
|---|---|
| chainguard-forks / kaniko | affected >= 1.25.4, < 1.25.10 |
CWE
CWE-22
References
- https://github.com/chainguard-forks/kaniko/security/advisories/GHSA-6rxq-q92g-4rmf
- https://github.com/chainguard-forks/kaniko/pull/326
- https://github.com/chainguard-forks/kaniko/commit/a370e4b1f66e6e842b685c8f70ed507964c4b221
ADP enrichment
No English description supplied.
No references supplied.
A flaw was found in kaniko, a tool used to build container images. A remote attacker can exploit this vulnerability by providing a specially crafted build context archive that contains path traversal sequences. This allows files to be written outside the intended destination directory during archive unpacking. When chained with docker credential helpers in environments with registry authentication, this can lead to arbitrary code execution within the executor process.