CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-54250

CVE-2026-54250: Path Traversal Vulnerability in K3s etcd Snapshot Decompression

Alon Barad
Alon Barad
Software Engineer

Jul 14, 2026·6 min read·27 visits

Executive Summary (TL;DR)

A Zip Slip path traversal vulnerability in K3s allows administrative users with snapshot restore capabilities to write arbitrary files to the host filesystem, potentially leading to remote code execution and host takeover.

CVE-2026-54250 is a path traversal vulnerability in K3s, a lightweight Kubernetes distribution. The flaw exists within the etcd snapshot decompression functionality, allowing administrative users to write arbitrary files to the host filesystem via a maliciously crafted ZIP archive. Due to the high privilege level of the K3s process, this can result in total host compromise.

Vulnerability Overview

The affected component is the etcd snapshot decompression subsystem within the K3s lightweight Kubernetes distribution. K3s simplifies cluster operations by providing built-in utilities for backing up and restoring cluster state. The vulnerability manifests when an administrator restores an etcd snapshot packaged inside a compressed ZIP archive.

This flaw is classified under CWE-22, representing improper limitation of a pathname to a restricted directory, also known as a Zip Slip vulnerability. The attack surface is exposed directly through the command-line interface when executing snapshot restoration commands. An attacker who successfully exploits this flaw can bypass directory boundaries to write arbitrary files onto the host filesystem.

Because the core K3s process runs with elevated administrative privileges, typically as root, any files written via this mechanism inherit these root privileges. This permits unauthorized modification of critical system directories outside the designated snapshot storage area. The impact is restricted to the host where the recovery command is executed, representing a host-level integrity threat.

Root Cause Analysis

The root cause of this vulnerability lies in the naive extraction logic employed by K3s when processing compressed snapshot archives. When a ZIP file is supplied for restoration, the decompression routine iterates over the individual files declared within the archive. For each file, the application constructs the output target path by concatenating the destination directory with the filename header provided by the archive.

In Go, this concatenation is commonly performed using filepath.Join, which automatically runs filepath.Clean on the resulting path string. However, if the filename header contains directory traversal sequences such as ../, filepath.Clean resolves these sequences relative to the destination directory. Consequently, if the archive header specifies ../../../../etc/shadow, the resolved path points outside the designated restoration directory.

To prevent directory traversal, an application must perform explicit validation to ensure that the resolved target path remains a child of the destination directory. Prior to the fix, K3s did not perform any prefix-check or boundary validation on the generated target paths. The decompression process blindly trusted the archive headers, writing the decompressed payloads to arbitrary filesystem locations.

Code Analysis

To understand the vulnerable pattern, consider the typical implementation of ZIP file extraction in Go without path verification. The application reads each header, constructs the destination path, and opens the file for writing.

// Vulnerable Implementation Pattern
for _, file := range zipReader.File {
    // Naive concatenation allows path traversal
    targetPath := filepath.Join(destinationDir, file.Name)
    
    // The application creates the directory structure and writes the file
    if err := os.MkdirAll(filepath.Dir(targetPath), 0755); err != nil {
        return err
    }
    
    outFile, err := os.OpenFile(targetPath, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, file.Mode())
    if err != nil {
        return err
    }
    defer outFile.Close()
    // ... copy contents ...
}

The remediated implementation prevents this directory traversal by verifying the relative relationship between the destination directory and the targeted write path. It ensures that the absolute target path contains the absolute destination directory path as a prefix.

// Remediated Implementation Pattern
cleanDest := filepath.Clean(destinationDir)
for _, file := range zipReader.File {
    targetPath := filepath.Join(cleanDest, file.Name)
    
    // Verify that the target path does not escape the destination directory
    rel, err := filepath.Rel(cleanDest, targetPath)
    if err != nil || strings.HasPrefix(rel, "..") || strings.HasPrefix(rel, string(filepath.Separator)) {
        return fmt.Errorf("illegal file path: %s", file.Name)
    }
    
    // Proceed safely with extraction
    if err := os.MkdirAll(filepath.Dir(targetPath), 0755); err != nil {
        return err
    }
    // ... write contents ...
}

Exploitation Methodology

Exploitation of CVE-2026-54250 requires local administrative privileges or a social-engineering vector to coerce an administrator into restoring a corrupted snapshot. The attacker must construct a malicious ZIP archive that includes an etcd snapshot database alongside targeted traversal paths. These paths point to critical system files or executable directories, such as /etc/cron.d or /etc/systemd/system.

Once the ZIP file is staged on the host, the attacker triggers the decompression by executing the K3s server reset command with the target restoration path argument. The command format is k3s server --cluster-reset --cluster-reset-restore-path=/path/to/archive.zip. Upon execution, the K3s server process, running as root, unpacks the snapshot.

The extraction process writes the malicious files to the absolute paths specified in the traversal sequence. For instance, writing a payload into /etc/cron.d/malicious_job forces the host operating system's cron daemon to execute arbitrary commands. This achieves local privilege escalation and full host compromise, bypassing containerization boundaries completely.

Impact Assessment

The severity of CVE-2026-54250 is evaluated as Medium with a CVSS v3.1 base score of 5.8. The attack complexity is low, but the vulnerability requires high privileges (PR:H) and user interaction (UI:R) to execute. The scope is unchanged (S:U), and the direct impact is limited to integrity (I:H) and availability (A:H) of the host operating system.

While classified as Medium, the real-world impact of successful exploitation is severe. An attacker can overwrite critical system files, including the /etc/shadow file, shell profiles, or systemd services. This capability guarantees immediate execution of arbitrary code with root privileges on the next service initialization or cron schedule execution.

Additionally, an attacker can overwrite internal K3s binaries, local certificate authority files, or database configurations. This can cause persistent denial of service conditions or compromise the identity and security of the entire Kubernetes cluster managed by the affected node.

Remediation & Mitigations

The recommended remediation is updating the K3s installation to a patched release. For the 1.35 branch, upgrade to version 1.35.3+k3s1 or later. For the 1.34 branch, upgrade to version 1.34.6+k3s1 or later. For legacy installations, migrate to version v1.33.10+k3s1 or later.

In environments where immediate upgrading is not possible, administrators can mitigate the risk by setting the GODEBUG environment variable. By running GODEBUG=zipinsecurepath=0 prior to executing the K3s restore command, the Go runtime actively blocks files containing insecure traversal paths from being decompressed.

Alternatively, administrators can bypass the K3s ZIP extraction logic entirely by manually decompressing the ZIP snapshot using a secure utility like unzip. After ensuring no unexpected files exist in the manual destination folder, the restore operation can be pointed directly to the uncompressed etcd database file, which prevents K3s from executing its internal ZIP parser.

Official Patches

K3sK3s Security Advisory

Technical Appendix

CVSS Score
5.8/ 10
CVSS:3.1/AV:L/AC:L/PR:H/UI:R/S:U/C:N/I:H/A:H
EPSS Probability
0.12%
Top 98% most exploited

Affected Systems

K3s Control-Plane Server Nodes

Affected Versions Detail

Product
Affected Versions
Fixed Version
K3s
Rancher/SUSE
>= 1.35.0-rc1+k3s1 to < 1.35.3+k3s11.35.3+k3s1
K3s
Rancher/SUSE
>= 1.34.0-rc1+k3s1 to < 1.34.6+k3s11.34.6+k3s1
K3s
Rancher/SUSE
< v1.33.10+k3s1v1.33.10+k3s1
AttributeDetail
CWE IDCWE-22
Attack VectorLocal (AV:L)
CVSS Score5.8 (Medium)
EPSS Score0.00122 (Percentile: 2.32%)
Exploit StatusUnproven/None
CISA KEV StatusNot Listed

MITRE ATT&CK Mapping

T1222File and Directory Permissions Modification
Defense Evasion
T1037Boot or Logon Initialization Scripts
Persistence
CWE-22
Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

The product uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize elements such as '..' that can resolve to a location outside of the intended directory.

References & Sources

  • [1]GitHub Security Advisory GHSA-jxr7-mqhw-9p98
  • [2]NVD Vulnerability Details
  • [3]CVE Org Record
  • [4]K3s Source Code Repository
  • [5]K3s Official Documentation on Restoring Snapshots
  • [6]Go archive/zip Insecure Path Protections

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•15 minutes ago•CVE-2026-53653
8.7

CVE-2026-53653: Unauthenticated Denial of Service via Unbounded Image Derivative Dimensions in Grav CMS

Grav CMS prior to version 1.7.53 and 2.0.0-rc.8 is vulnerable to an unauthenticated remote denial of service (DoS) vulnerability. By supplying crafted query parameters with extremely large dimensions to image assets, remote unauthenticated attackers can force the server to allocate massive amounts of system memory, leading to kernel Out-Of-Memory (OOM) termination of web worker processes.

Amit Schendel
Amit Schendel
0 views•7 min read
•about 1 hour ago•CVE-2026-53657
8.2

CVE-2026-53657: Privilege Escalation via Overly Permissive Unix Domain Socket in Lima Guest Agent

CVE-2026-53657 is a local privilege escalation vulnerability in Lima (lima-vm/lima) affecting versions prior to 2.1.3 when configured with the QEMU driver. The guest agent daemon, running as root, creates its communication socket `/run/lima-guestagent.sock` with world-writable permissions (0777). This allows unprivileged local users to command the agent to establish arbitrary tunnels, including to privileged local UNIX sockets (like D-Bus). Because the target daemon authenticates the incoming connection using the credentials of the root-owned guest agent (via SO_PEERCRED), unprivileged users can perform root operations, resulting in complete guest VM compromise.

Amit Schendel
Amit Schendel
2 views•9 min read
•about 2 hours ago•CVE-2026-10740
5.3

CVE-2026-10740: Denial of Service in s2n-quic CryptoStream Reassembly

An unauthenticated Denial of Service vulnerability exists in the s2n-quic library's CryptoStream reassembler due to a lack of buffer limits on out-of-order cryptographic frames. An attacker can transmit a crafted CRYPTO frame with an extremely high offset and nominal payload, forcing the receiver to execute unbounded memory allocations and causing service crashes.

Amit Schendel
Amit Schendel
3 views•7 min read
•about 3 hours ago•CVE-2026-55153
7.1

CVE-2026-55153: JNDI Injection and Deserialization Gadget Abuse in mchange-commons-java

A JNDI Injection and Deserialization Gadget vulnerability exists in mchange-commons-java prior to version 0.6.0. The com.mchange.v2.naming.JavaBeanObjectFactory component permits arbitrary class instantiation and setter invocation, allowing attackers to perform Server-Side Request Forgery (SSRF) and remote class loading.

Alon Barad
Alon Barad
6 views•5 min read
•about 4 hours ago•GHSA-8RW6-P7M8-63JP
6.5

GHSA-8RW6-P7M8-63JP: Array Element-Level SELECT Permissions Leak in SurrealDB

SurrealDB versions supporting element-level SELECT permissions on arrays are vulnerable to a logical authorization bypass. Due to an index-shifting error during array filtration, restricted elements can skip permission checks and leak to unauthorized record users.

Alon Barad
Alon Barad
5 views•6 min read
•1 day ago•CVE-2026-12243
7.5

CVE-2026-12243: Incomplete Path Traversal Validation and Percent-Encoding Bypass in NLTK

CVE-2026-12243 is a path traversal vulnerability in the Natural Language Toolkit (NLTK) version 3.9.4. The flaw exists because the input validation routine fails to account for percent-encoded directory traversal sequences like '..%2f' before passing them to urllib.request.url2pathname(), which decodes them into active traversal sequences.

Amit Schendel
Amit Schendel
5 views•8 min read