Summary
A path traversal flaw in the compressedEndpoint field of Rancher UIPlugin deployments allows a malicious Rancher Extension to write files outside its intended directory.
Under certain deployment configurations, this can enable attackers to overwrite Rancher binaries or configuration, tamper with cluster state, or even write to the underlying host filesystem.
Affected context
This vulnerability affects environments using Rancher Extensions, specifically UI plugins deployed via UIPlugin configurations that accept a compressedEndpoint value.
The risk is most pronounced where:
- Extensions are installed from sources that are not fully trusted, and
- The Rancher manager has write access to sensitive paths such as its own binary/config directories,
/var/lib/rancher/, or hostPath-mounted directories.
The issue surfaces when the plugin deployment process resolves paths derived from compressedEndpoint without enforcing strict directory constraints.
Exploit preconditions
- Attack surface: Rancher Extensions / UIPlugin deployment APIs or mechanisms.
- Required access: Ability to register or update a Rancher UI Extension (e.g., manage or influence
UIPluginspecs or extension catalog entries). - Trigger point: Processing and extraction of the archive or assets referenced by
compressedEndpointduring plugin deployment/update. - Why exploitation is possible: The
compressedEndpointvalue is used to construct filesystem paths without proper normalization and enforcement of a fixed base directory, allowing traversal sequences (e.g.,../) to escape the intended location and target arbitrary writable paths.
Why this happens
The core issue is a classic directory traversal pattern where user-controlled path components are concatenated or resolved into filesystem paths without robust sanitization or confinement.
Instead of enforcing a strict, canonicalized base directory for extracted extension assets, the implementation appears to trust the compressedEndpoint value and fails to strip or reject traversal sequences.
This aligns with CWE-35: Path Traversal, where improper validation of paths derived from untrusted input permits read or write access outside the intended directory, turning plugin installation into a vehicle for arbitrary file placement or overwrite.
Potential impact
- Overwriting Rancher binaries or configuration files, which can lead to:
- Execution of injected code in the Rancher management plane
- Persistent compromise of Rancher services
- Tampering with data under
/var/lib/rancher/, potentially: - Corrupting or altering cluster state and metadata
- Impacting cluster lifecycle, node registration, or workloads
- Writing into host node filesystems via hostPath volumes, which can:
- Modify host configuration or binaries
- Facilitate container escape or broader node compromise
- Providing a foothold to chain with other vulnerabilities or misconfigurations for privilege escalation or lateral movement.
General mitigation guidance
Effective mitigation typically focuses on constraining file system writes and hardening extension trust boundaries:
- Normalize and canonicalize all paths derived from
compressedEndpoint, and verify that the final resolved path remains within a predefined, dedicated extensions directory. - Reject any plugin input that contains path traversal indicators (e.g.,
.., absolute paths, or symbolic link chains that escape the allowed root). - Run the Rancher manager and extension processing components with least-privilege filesystem access, avoiding unnecessary write permissions to binary directories,
/var/lib/rancher/, or hostPath-mounted locations. - Treat extensions as untrusted by default: establish a review and signing process for third-party or custom extensions, and limit who can register or update
UIPluginresources. - Consider segregating extension storage into separate volumes with restricted mount options and no direct mapping to hostPath volumes where feasible.
How teams detect issues like this
High-level detection can combine static review of code and runtime controls:
- Static analysis / code review:
- Look for any logic that constructs destination paths from extension metadata (including
compressedEndpoint) without: - Canonicalization (
realpath-style checks) - Explicit base directory enforcement
- Flag direct concatenation of user-controlled path segments into
open,write, extraction utilities, or archive unpacking routines. - Configuration and policy review:
- Enforce policies that restrict who may install or update Rancher Extensions and
UIPluginresources. - Audit cluster configurations for hostPath mounts exposed to components processing extensions, and reduce these where possible.
- Runtime monitoring:
- Monitor Rancher manager pods for unexpected write activity to critical paths (binaries, configuration directories,
/var/lib/rancher/, and hostPath targets). - Use file integrity monitoring (FIM) on Rancher-related directories and sensitive host paths to detect unexpected modifications following extension changes.
- Automated security scanning tools and CI/CD hooks can be configured to flag directory traversal patterns and risky filesystem operations in extension management code.

