Mar 1, 2026·5 min read·103 visits
Kaniko versions 1.25.4 through 1.25.9 contain a path traversal flaw (CWE-22) during build context unpacking. Attackers can provide a malicious tar archive to overwrite arbitrary files in the container, leading to potential RCE.
A high-severity path traversal vulnerability exists in the Kaniko container image builder, specifically within the `chainguard-forks/kaniko` distribution. The vulnerability resides in the build context extraction logic, where the application fails to properly validate tar archive entries before writing them to the filesystem. By crafting a malicious tarball containing files with relative path sequences (e.g., `../../`), an attacker can escape the intended extraction directory. This allows for arbitrary file writes on the container filesystem, which can potentially lead to Remote Code Execution (RCE) by overwriting system binaries or credential helpers used during the build process.
Kaniko is a tool designed to build container images from a Dockerfile, inside a container or Kubernetes cluster. A core phase of its operation involves unpacking a 'build context'—typically a compressed tar archive containing the application source code and Dockerfile. This process is expected to occur within a strictly confined directory (the workspace).
CVE-2026-28406 identifies a critical flaw in how Kaniko handles file paths within these archives. When extracting tar entries, the application fails to enforce that the destination path remains within the intended workspace root. This is a classic 'Zip Slip' or 'Tar Slip' vulnerability (CWE-22).
If an attacker can manipulate the build context (common in CI/CD pipelines where developers submit code/artifacts), they can include files with relative path traversals (e.g., ../../usr/bin/malicious). Upon extraction, Kaniko writes these files outside the workspace, overwriting system files on the builder's filesystem. This undermines the integrity of the build environment and facilitates further compromise.
The vulnerability stems from the unsafe usage of Go's path/filepath package during archive iteration. Specifically, the application relied on filepath.Clean and filepath.Join to determine the destination path for extraction. While filepath.Clean canonicalizes a path by removing redundant separators and . elements, it does not strip leading ../ components if they are syntactically valid relative to the input string.
In the vulnerable implementation, the code essentially performed the following operation:
// Vulnerable logic pattern
cleanedName := filepath.Clean(header.Name)
// If header.Name is "../../file", cleanedName remains "../../file"
destination := filepath.Join(extractionRoot, cleanedName)The filepath.Join function resolves the path lexically. If cleanedName contains directory traversal sequences, the resulting destination path points outside extractionRoot. There was no subsequent check to verify that the resolved absolute path still shared the extractionRoot as its prefix.
Furthermore, the implementation lacked secure handling for symbolic links within the tar archive. A malicious symlink pointing to a parent directory could also be used to bypass path restrictions, allowing subsequent writes to traverse out of the sandbox.
The remediation involves replacing the naive path joining logic with securejoin, a library specifically designed to safely resolve paths within a chroot-like scope, and adding explicit lexical checks.
The fix was applied in pkg/util/fs_util.go. Below is a comparative analysis of the vulnerable and patched code paths.
Vulnerable Code (Simplified):
// The code simply cleans the name and joins it to the destination
cleanedName := filepath.Clean(hdr.Name)
path := filepath.Join(dest, cleanedName)
// File is written to 'path' immediately without boundary checksPatched Code (Commit a370e4b1):
// 1. Lexical Validation: Reject explicit parent references immediately
if cleanedName == ".." || strings.HasPrefix(cleanedName, "../") {
return fmt.Errorf("tar entry %q is not allowed: references parent directory", hdr.Name)
}
// 2. Secure Path Resolution: Use securejoin to handle symlinks and boundaries
path, err := securejoin.SecureJoin(dest, cleanedName)
if err != nil {
return err
}
// 3. Post-Resolution Validation (Defense in Depth)
// Ensure the resolved path is actually inside the destination
if !strings.HasPrefix(path, dest) {
return fmt.Errorf("tar entry %q resolves outside destination directory", hdr.Name)
}The introduction of github.com/cyphar/filepath-securejoin ensures that even complex symlink attacks are mitigated, as SecureJoin emulates the kernel's path resolution logic in userspace to prevent breakouts.
To exploit this vulnerability, an attacker requires the ability to provide a build context to the Kaniko process. This is a standard workflow in CI/CD pipelines where Kaniko builds images based on repository contents.
Attack Vector Construction:
../ for safety, so a script (e.g., Python or Go) is required to forcefully inject the traversal sequences.docker-credential-gcr or docker-credential-ecr-login).../../usr/bin/docker-credential-gcr. The content of this entry is a malicious binary or shell script.Proof of Concept Concept:
import tarfile
with tarfile.open("exploit.tar.gz", "w:gz") as tar:
# Create a file that looks like a credential helper
tar.add("malicious_script.sh", arcname="../../usr/local/bin/docker-credential-gcr")The impact of CVE-2026-28406 is rated as High (CVSS 8.2). While the vulnerability is technically a path traversal, the context of Kaniko's operation elevates the risk significantly.
Integrity (High): The primary impact is arbitrary file overwrites. An attacker can modify any file the Kaniko process has write access to. In containerized build environments, Kaniko typically runs as root to perform filesystem operations required for image construction.
Confidentiality (Indirect): While the vulnerability is a write-primitive, it can lead to data exfiltration. By replacing binaries that handle secrets (like credential helpers or git wrappers), an attacker can capture authentication tokens or source code during subsequent build steps.
Availability (Low): An attacker could corrupt essential system libraries or binaries, causing the build pipeline to fail repeatedly (Denial of Service).
EPSS & Threat Landscape: As of late February 2026, the EPSS score is relatively low (0.12%), and there are no reports of active exploitation in the wild (CISA KEV negative). However, given the popularity of Kaniko in Kubernetes CI/CD (Tekton, Jenkins X, GitLab), this represents a significant latent risk for supply chain security.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:L| Product | Affected Versions | Fixed Version |
|---|---|---|
kaniko chainguard-forks | >= 1.25.4, < 1.25.10 | 1.25.10 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-22 |
| Attack Vector | Network (Context Injection) |
| CVSS v3.1 | 8.2 (High) |
| EPSS Score | 0.12% |
| Exploit Status | PoC Available |
| KEV Status | Not Listed |
The software uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the software does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.
An uncontrolled resource consumption vulnerability in the knative.dev/pkg/webhook package allows network-adjacent attackers within a Kubernetes cluster to trigger Out-Of-Memory (OOM) terminations of admission controller pods. The admission webhook HTTP server processes incoming AdmissionReview requests through an io.TeeReader and json.Decoder pipeline without enforcing an upper bound on request body size. Due to internal buffer reallocation mechanics, incoming payloads experience a 4.5x memory amplification factor. Because knative.dev/pkg provides the shared webhook server foundation for numerous cloud-native projects—including Knative Serving, Knative Eventing, Tekton, KEDA, Sigstore Policy Controller, and Kpack—exploitation can halt resource admission across entire Kubernetes clusters or bypass critical security validation policies.
CVE-2026-115923 (GHSA-w658-mh9p-ww8f) is a path traversal and access control bypass vulnerability in Spotify's Backstage developer portal framework, specifically within the @backstage/plugin-catalog-backend package. Prior to patched versions, DefaultCatalogRulesEnforcer evaluated user-supplied URL catalog locations against configured catalog.rules patterns using raw, uncanonicalized strings. Because downstream URL readers canonicalize URLs and resolve dot segments before fetching resources, an authenticated attacker with location registration permissions can supply percent-encoded traversal sequences (such as %2e%2e) to bypass location restrictions and register untrusted catalog entities.
CVE-2026-116576 (GHSA-3f7j-7jwc-fxfj) is an OS Command Injection vulnerability (CWE-78) in the Node.js systeminformation library prior to version 5.33.16 on Microsoft Windows. The services() API function dynamically constructs a PowerShell Get-CimInstance command using caller-supplied service names passed through sanitizeShellString(). While the sanitizer strips standard ASCII quotation marks, it permits Unicode typographic quotation marks (U+2018 through U+201E). Because the Windows PowerShell tokenizer recognizes Unicode quotation marks as valid string literal delimiters, an attacker who controls the service name input can break out of the CIM filter string and execute arbitrary PowerShell commands within the security context of the Node.js process.
An interpretation conflict vulnerability (CWE-436) exists in the Ruby CSS parser library Crass prior to version 1.0.8. When consuming the remnants of a malformed URL token, the tokenizer erroneously checks the previously consumed character to determine if a valid escape sequence is present. Consequently, a closing parenthesis immediately following an escaped backslash sequence is treated as escaped by Crass, while spec-compliant web browsers treat the closing parenthesis as the end of the bad URL token. Downstream CSS sanitizers such as Sanitize, Loofah, and rails-html-sanitizer that rely on Crass to parse and reserialize untrusted CSS can be bypassed to inject arbitrary CSS declarations, style rules, and external @import directives.
Tornado versions prior to 6.6.0 contain an inefficient algorithmic complexity vulnerability in the HTTP header parser. When processing requests with obsolete line folding (obs-fold), the HTTPHeaders.parse_line method repeatedly concatenates immutable Python strings within a list structure. An unauthenticated remote attacker can send an HTTP request containing thousands of short header continuation lines to trigger quadratic O(N^2) CPU consumption on the main IOLoop thread, starving concurrent connections and resulting in a denial of service.
Tornado versions prior to 6.6.0 contain an open redirect vulnerability (CWE-601) in tornado.web.RedirectHandler. When route templates incorporate regular expression capture groups at the start of a path, directly after a fixed host without a trailing slash, or at the beginning of a destination template, unvalidated URL-decoded parameters allow attackers to manipulate the redirect scheme or network location. Because modern browsers normalize URLs according to the WHATWG specification—treating backslashes as forward slashes and stripping control characters—attackers can bypass naive prefix checks and redirect victims to arbitrary external domains.