Skip to content

GHSA-c38g-469g-cmgx BIT-helm-2021-21303 CVE-2021-21303 GO-2022-1040

Improper Neutralization of Special Elements in Output in helm.sh/helm/v3

Medium Go
Severity
6.5 / 10
Medium · CVSS 3.1
Exploit chance (EPSS)
1.09%
Chance of exploitation in the next 30 days. Higher than 65.30% of scored vulnerabilities.
Known exploited
No
Not in CISA's catalog
Weakness
CWE-74 Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')
Fix
3.5.2
Upgrade helm.sh/helm/v3 to this version or later

Description

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.

Affected versions

Go

PackageVulnerableFixed in
helm.sh/helm/v3
>= 3.0.0, < 3.5.2
3.5.2

How to fix

Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.

helm.sh/helm/v3 Go → 3.5.2

go
go get helm.sh/helm/v3@v3.5.2 && go mod tidy

Severity breakdown

CVSS 3.1 6.5

CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:N/I:H/A:N

Attack vector
Local
Attack complexity
Low
Privileges required
Low
User interaction
None
Scope
Changed
Confidentiality
None
Integrity
High
Availability
None

Weakness

CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')

The product constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component.

How to prevent it
  • Requirements: Programming languages and supporting technologies might be chosen which are not subject to these issues.
  • Implementation: Utilize an appropriate mix of allowlist and denylist parsing to filter control-plane syntax from all input.

References

Timeline

  1. Published
  2. Last updated by the source
  3. Latest EPSS score
AdvisorySeverityWhy it's related
GHSA-hr2v-4r36-88hr
Helm Chart extraction output directory collapse via `Chart.yaml` name dot-segment
Medium Also affects helm.sh/helm/v3
GHSA-f9f8-9pmf-xv68
Helm May Panic Due To Incorrect YAML Content
Medium Also affects helm.sh/helm/v3
GHSA-9h84-qmv7-982p
Helm Charts with Specific JSON Schema Values Can Cause Memory Exhaustion
Medium Also affects helm.sh/helm/v3
GHSA-557j-xg8c-q2mm
Helm vulnerable to Code Injection through malicious chart.yaml content
High Also affects helm.sh/helm/v3
GHSA-5xqw-8hwv-wg92
Helm Allows A Specially Crafted JSON Schema To Cause A Stack Overflow
Medium Also affects helm.sh/helm/v3
GHSA-4hfp-h4cw-hj8p
Helm Allows A Specially Crafted Chart Archive To Cause Out Of Memory Termination
Medium Also affects helm.sh/helm/v3
GHSA-r53h-jv2g-vpx6
Helm's Missing YAML Content Leads To Panic
High Also affects helm.sh/helm/v3
GHSA-v53g-5gjp-272r
Helm dependency management path traversal
Medium Also affects helm.sh/helm/v3
Is this in your code?

MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.

Check your repos with MergeHarbor