CVE-2026-28406: kaniko has tar archive path traversal in build context extraction allows writing files outside destination directory

Published Feb 27, 2026
·
Updated

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.

Other sources

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.

— GitHub

Affected Software

3 affected componentsFixes available
kaniko>1.25.4<=1.25.10
go/github.com/chainguard-dev/kaniko>=1.25.4<1.25.10
1.25.10
chainguard kaniko>=1.25.4<1.25.10

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade go/github.com/chainguard-dev/kaniko to a version that resolves this vulnerability.

    Fixed in 1.25.10
  2. Upgrade

    Upgrade kaniko to a version that resolves this vulnerability.

    Fixed in 1.25.10
  3. Compensating control

    If upgrading is not immediately possible, prevent attackers from supplying or influencing build context tar archives/entries (e.g., block/validate build context inputs so tar entries cannot include path traversal like "../outside.txt").

Event History

Feb 27, 2026
CVE Published
via MITRE·09:20 PM
Data Sourced
via MITRE·09:20 PM
DescriptionSeverityWeakness
Data Sourced
via Red Hat·10:02 PM
DescriptionSeverityAffected Software
Data Sourced
via NVD·10:16 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·10:16 PM
RemedyAffected Software
Mar 1, 2026
Advisory Published
via GitHub·01:28 AM
Data Sourced
via GitHub·01:28 AM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2026-28406?

CVE-2026-28406 has been classified with a medium severity due to its potential for allowing unauthorized file writes outside designated directories.

2

How do I fix CVE-2026-28406?

To fix CVE-2026-28406, upgrade kaniko to version 1.25.10 or later, which contains the necessary patches.

3

Which versions of kaniko are affected by CVE-2026-28406?

kaniko versions between 1.25.4 and 1.25.10 are affected by CVE-2026-28406.

4

What type of vulnerability is CVE-2026-28406?

CVE-2026-28406 is a path traversal vulnerability found in kaniko during the extraction of build context from tar archives.

5

Can CVE-2026-28406 be exploited in a Kubernetes environment?

Yes, CVE-2026-28406 can be exploited in a Kubernetes environment where kaniko is used for building container images.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203