5.9medium
Injection attack in Helm
- Severity
- 5.9medium CVSS:3.1 by GitHub_M
- Exploit likelihood
- 1.09% (higher than 66% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-c38g-469g-cmgxBIT-HELM-2021-21303GO-2022-1040
Description
Helm is open-source software which is essentially "The Kubernetes Package Manager". Helm is a tool for managing Charts. Charts are packages of pre-configured Kubernetes resources. In Helm from version 3.0 and before version 3.5.2, there a few cases where data loaded from potentially untrusted sources was not properly sanitized. When a SemVer in the `version` field of a chart is invalid, in some cases Helm allows the string to be used "as is" without sanitizing. Helm fails to properly sanitized some fields present on Helm repository `index.yaml` files. Helm does not properly sanitized some fields in the `plugin.yaml` file for plugins In some cases, Helm does not properly sanitize the fields in the `Chart.yaml` file. By exploiting these attack vectors, core maintainers were able to send deceptive information to a terminal screen running the `helm` command, as well as obscure or alter information on the screen. In some cases, we could send codes that terminals used to execute higher-order logic, like clearing a terminal screen. Further, during evaluation, the Helm maintainers discovered a few other fields that were not properly sanitized when read out of repository index files. This fix remedies all such cases, and once again enforces SemVer2 policies on version fields. All users of the Helm 3 should upgrade to the fixed version 3.5.2 or later. Those who use Helm as a library should verify that they either sanitize this data on their own, or use the proper Helm API calls to sanitize the data.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| helm helm | > 3.0, < 3.5.2, from 3.0.0 before 3.5.2 | CVE List, NVD |
| helm.sh/helm/v3 (Go) | from 3.0.0 before 3.5.2 | GitHub Advisory Database, Go Vulnerability Database |
| helm (Bitnami) | from 3.0.0 before 3.5.2 | Bitnami Vulnerability Database |
All scores
| GitHub_M | 5.9medium CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:C/C:N/I:H/A:N |
| GitHub | 6.5medium CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:N/I:H/A:N |
| NVD | 6.8medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:N/I:H/A:N |
| NVD | 3.5low CVSS:2.0 | AV:N/AC:M/Au:S/C:N/I:P/A:N |
| Bitnami Vulnerability Database | medium rating |
Classification
What each source says
CVE List
Helm is open-source software which is essentially "The Kubernetes Package Manager". Helm is a tool for managing Charts. Charts are packages of pre-configured Kubernetes resources. In Helm from version 3.0 and before version 3.5.2, there a few cases where data loaded from potentially untrusted sources was not properly sanitized. When a SemVer in the `version` field of a chart is invalid, in some cases Helm allows the string to be used "as is" without sanitizing. Helm fails to properly sanitized some fields present on Helm repository `index.yaml` files. Helm does not properly sanitized some fields in the `plugin.yaml` file for plugins In some cases, Helm does not properly sanitize the fields in the `Chart.yaml` file. By exploiting these attack vectors, core maintainers were able to send deceptive information to a terminal screen running the `helm` command, as well as obscure or alter information on the screen. In some cases, we could send codes that terminals used to execute higher-order logic, like clearing a terminal screen. Further, during evaluation, the Helm maintainers discovered a few other fields that were not properly sanitized when read out of repository index files. This fix remedies all such cases, and once again enforces SemVer2 policies on version fields. All users of the Helm 3 should upgrade to the fixed version 3.5.2 or later. Those who use Helm as a library should verify that they either sanitize this data on their own, or use the proper Helm API calls to sanitize the data.
GitHub Advisory Database
Since Helm 2 was released, a well-documented aspect of Helm is that the Helm chart's version number MUST follow the SemVer2 specification. In the past, Helm would not permit charts with malformed versions. At some point, a patch was merged that changed this - On a version parse error, the version number was simply passed along as-is. This provided a vector for malicious data to be injected into Helm and potentially used in various ways.
Core maintainers were able to send deceptive information to a terminal screen running the helm command, as well as obscure or alter information on the screen. In some cases, we could send codes that terminals used to execute higher-order logic, like clearing a terminal screen.
Further, during evaluation, the Helm maintainers discovered a few other fields that were not properly sanitized when read out of repository index files. This fix remedies all such cases, and once again enforces SemVer2 policies on version fields.
All users of the Helm 3 should upgrade.
Those who use Helm as a library should verify that they either sanitize this data on their own, or use the proper Helm API calls to sanitize the data.
Patches
This issue has been resolved in Helm 3.5.2.
While this fix does not constitute a breaking change, as all field formatting is now enforced as documented, it is possible that charts that were mistakenly allowed (but invalid) may no longer be available in search indexes. Specifically, malformed SemVer versions are no longer supported. This has always been the documented case, but it is true that malformed versions were allowed.
Note that this is the first security release since Helm 2's final deprecation. Helm 2 was not audited for vulnerability to this issue, and should be assumed vulnerable.
Go Vulnerability Database
Helm does not sanitize all fields read from repository data files. A maliciously crafted data file may contain strings containing arbitrary data. If printed to a terminal, a malicious string could obscure or alter data on the screen.
NVD (es)
"Helm es un software de código abierto que es esencialmente ""The Kubernetes Package Manager"". Helm es una herramienta para gestionar Gráficos. Los Gráficos son paquetes de recursos Kubernetes preconfigurados. En Helm versiones desde 3.0 y anteriores a 3.5.2, había algunos casos en los que los datos cargados desde fuentes potencialmente no confiables no eran saneados apropiadamente. Cuando un SemVer en el campo ""version"" de un gráfico no es válido, en algunos casos Helm permite que la cadena sea usada ""as is"" sin sanearla. Helm no sanea apropiadamente algunos campos presentes en los archivos ""index.yaml"" del repositorio Helm. Helm no sanea correctamente algunos campos del fichero ""plugin.yaml"" para los plugins En algunos casos, Helm no sanea apropiadamente los campos del fichero ""Chart.yaml"". Al explotar estos vectores de ataque, los mantenedores principales fueron capaces de enviar información engañosa a una pantalla de terminal que ejecutaba el comando ""helm"", así como oscurecer o alterar la información en la pantalla. En algunos casos, podíamos enviar códigos que los terminales usaban para ejecutar lógica de orden superior, como borrar la pantalla de un terminal. Además, durante la evaluación, los mantenedores de Helm detectaron algunos otros campos que no estaban apropiadamente saneados cuando se leían desde los archivos de índice del repositorio. Esta corrección remedia todos estos casos, y una vez más aplica las políticas de SemVer2 en los campos version. Todos los usuarios de Helm 3 deberían actualizar a la versión corregida 3.5.2 o posterior. Aquellos que usen Helm como una biblioteca deberían verificar que sanean estos datos por su cuenta, o que usan las llamadas apropiadas a la API de Helm para sanear los datos
References
| https://github.com/helm/helm/security/advisories/GHSA-c38g-469g-cmgx | advisory, third-party-advisory, web | |
| https://github.com/helm/helm/commit/6ce9ba60b73013857e2e7c73d3f86ed70bc1ac9a | advisory, fix, patch, third-party-advisory, web | |
| https://github.com/helm/helm/releases/tag/v3.5.2 | advisory, release-notes, third-party-advisory, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2021-21303 | advisory, web | |
| https://github.com/advisories/GHSA-c38g-469g-cmgx | advisory | |
| https://github.com/helm/helm | package | |
| https://pkg.go.dev/vuln/GO-2022-1040 | web | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2021-21303 changed 2024-08-03 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-c38g-469g-cmgx changed 2026-07-08 | CC-BY-4.0 |
| Go Vulnerability Database | GO-2022-1040 changed 2024-05-20 | CC-BY-4.0 |
| NVD | CVE-2021-21303 changed 2026-06-17 | Public domain |
| Bitnami Vulnerability Database | BIT-HELM-2021-21303 changed 2026-09-08 | Apache-2.0 |