Summary
A path traversal vulnerability in Helm versions 4.0.0 to 4.1.3 allows a specially crafted plugin to cause Helm to write plugin contents to an arbitrary filesystem location during installation or update.
If an attacker can trick a user or system into installing or updating a malicious Helm plugin, they may be able to overwrite sensitive files and potentially gain further control over the environment.
Affected context
This vulnerability occurs in environments using Helm 4.0.0–4.1.3 where plugins are installed or updated from untrusted or partially trusted sources.
The issue is specifically tied to how Helm processes fields in plugin.yaml during plugin installation and update, allowing directory traversal sequences in paths to influence where plugin files are written.
It becomes most risky in CI/CD pipelines, shared Kubernetes administration environments, or any context where plugin installation is automated or delegated to less-privileged users without strict source validation.
Exploit preconditions
- Attack surface: Helm plugin installation or update mechanism.
- Required access: Ability to supply or influence a Helm plugin package or its
plugin.yaml(e.g., via a malicious plugin repository, tampered artifact, or social engineering of an operator). - Trigger point: Running
helm plugin installorhelm plugin update(or equivalent automation) on the malicious plugin. - Why exploitation is possible: Helm versions 4.0.0–4.1.3 insufficiently validate path components derived from
plugin.yaml(notably theversionfield) and allow../style dot-dot sequences, enabling plugin contents to be written outside the intended plugin directory.
Why this happens
The underlying bug is a classic directory traversal issue where user-controlled data from plugin metadata is incorporated into filesystem paths without adequate normalization or validation.
Specifically, Helm's plugin installation logic trusts fields from plugin.yaml and permits POSIX dot-dot (../) sequences that traverse parent directories, mapping directly to CWE-22: Improper Limitation of a Pathname to a Restricted Directory.
Instead of constraining file writes to a fixed, canonical plugin directory and rejecting or sanitizing unsafe path fragments, the code allows crafted path components to redirect writes to attacker-chosen locations.
Potential impact
- Overwrite of arbitrary files accessible to the Helm process, such as configuration files or scripts.
- Injection or modification of shell scripts or binaries that may be executed later, enabling code execution.
- Corruption of Kubernetes deployment or Helm configuration, leading to denial of service or misconfigurations.
- Escalation of privileges in environments where overwritten files influence higher-privileged processes or automation.
General mitigation guidance
Mitigation focuses on treating all plugin metadata as untrusted input and constraining where plugin files can be written.
Recommended defensive patterns include:
- Enforce strict path validation on all metadata fields used to construct filesystem paths, rejecting any value containing
../, absolute paths, or unexpected separators. - Resolve paths against a known, fixed plugin root directory and verify that the resulting canonical path remains under that directory before writing any files.
- Apply allowlists for plugin metadata formats (e.g., version strings) that restrict them to simple, validated patterns rather than arbitrary text.
- Run Helm and its plugin management under least-privilege accounts with limited write access, reducing the blast radius of any arbitrary file write.
- Establish organizational policies to install plugins only from vetted, trusted repositories or internal mirrors, reducing the chance of malicious plugin metadata entering the environment.
How teams detect issues like this
Detection typically combines static review of the code paths handling plugin metadata with runtime monitoring of file operations.
Potential strategies:
- Use static analysis or manual code review to identify any use of user-controlled values from
plugin.yamlbeing concatenated into paths without normalization and boundary checks. - Implement security linters or CI checks that flag filesystem writes based on untrusted metadata, especially when dot-dot (
../) or absolute path handling is present. - Monitor Helm execution with audit logging or EDR tools to detect unexpected writes outside the standard plugin directories during plugin installation or update.
- Periodically scan plugin directories and surrounding filesystem regions for anomalous or newly modified files associated with plugin operations.

