CVE-2024-26147: Helm's Missing YAML Content Leads To Panic
A Helm contributor discovered uninitialized variable vulnerability when Helm parses index and plugin yaml files missing expected content.
Impact
When either an index.yaml file or a plugins plugin.yaml file were missing all metadata a panic would occur in Helm.
In the Helm SDK this is found when using the LoadIndexFile or DownloadIndexFile functions in the repo package or the LoadDir function in the plugin package. For the Helm client this impacts functions around adding a repository and all Helm functions if a malicious plugin is added as Helm inspects all known plugins on each invocation.
Patches
This issue has been resolved in Helm v3.14.2.
Workarounds
If a malicious plugin has been added which is causing all Helm client commands to panic, the malicious plugin can be manually removed from the filesystem.
If using Helm SDK versions prior to 3.14.2, calls to affected functions can use recover to catch the panic.
For more information
Helm's security policy is spelled out in detail in our SECURITY document.
Credits
Disclosed by Jakub Ciolek at AlphaSense.
Other sources
Helm is a package manager for Charts for Kubernetes. Versions prior to 3.14.2 contain an uninitialized variable vulnerability when Helm parses index and plugin yaml files missing expected content. When either an index.yaml file or a plugins plugin.yaml file were missing all metadata a panic would occur in Helm. In the Helm SDK, this is found when using the LoadIndexFile or DownloadIndexFile functions in the repo package or the LoadDir function in the plugin package. For the Helm client this impacts functions around adding a repository and all Helm functions if a malicious plugin is added as Helm inspects all known plugins on each invocation. This issue has been resolved in Helm v3.14.2. If a malicious plugin has been added which is causing all Helm client commands to panic, the malicious plugin can be manually removed from the filesystem. If using Helm SDK versions prior to 3.14.2, calls to affected functions can use recover to catch the panic.
— NVD
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
go/helm.sh/helm/v3to a version that resolves this vulnerability.Fixed in 3.14.2 - Upgrade
Upgrade
redhat/Helmto a version that resolves this vulnerability.Fixed in 3.14.2 - Upgrade
Upgrade
helm/helmto a version that resolves this vulnerability.Fixed in 3.14.2Patch GHSA-r53h-jv2g-vpx6 - Remove
Remove
helm/plugin (malicious plugin causing Helm client commands to panic)from your environment.If a malicious plugin has been added which is causing all Helm client commands to panic, manually remove the malicious plugin from the filesystem.
- Configuration
For Helm SDK versions prior to 3.14.2, wrap calls to affected functions with Go `recover` to catch the panic (repo: `LoadIndexFile` or `DownloadIndexFile`; plugin: `LoadDir`).
Helm SDK (repo/plugin packages) panic handling = recover
Event History
Frequently Asked Questions
What is the severity of CVE-2024-26147?
The severity of CVE-2024-26147 is classified as high due to the potential for a panic in Helm when processing malformed YAML files.
How do I fix CVE-2024-26147?
To fix CVE-2024-26147, you should upgrade to Helm version 3.14.2 or later immediately.
What are the affected versions in CVE-2024-26147?
CVE-2024-26147 affects all versions of Helm prior to 3.14.2.
What is the impact of CVE-2024-26147?
The impact of CVE-2024-26147 includes causing a panic in Helm when parsing an index.yaml or plugin.yaml file that is missing metadata.
Who discovered CVE-2024-26147?
CVE-2024-26147 was discovered by a contributor of the Helm project.