Loading...
Skip to main content

CVE-2022-24877 — Improper path handling in github.com/fluxcd/flux2...

CRITICAL

Improper path handling in kustomization files allows path traversal

Published May 4, 2022Updated September 10, 2026Source: osv

Summary

The kustomize-controller enables the use of Kustomize’s functionality when applying Kubernetes declarative state onto a cluster. A malicious user can use built-in features and a specially crafted `kustomization.yaml` to expose sensitive data from the controller’s pod filesystem. In multi-tenancy deployments this can lead to privilege escalation if the controller's service account has elevated permissions. Within the affected versions, users with write access to a Flux source are able to use built-in features to expose sensitive data from the controller’s pod filesystem using a malicious `kustomization.yaml` file. This vulnerability was fixed in kustomize-controller v0.24.0 and included in flux2 v0.29.0 released on 2022-04-20. The changes introduce a new Kustomize file system implementation which ensures that all files being handled are contained within the Kustomization working directory, blocking references to any files that do not meet that requirement. Automated tooling (e.g. conftest) could be employed as a workaround, as part of a user's CI/CD pipeline to ensure that their `kustomization.yaml` files conform with specific policies, blocking access to sensitive path locations.

Advisory Timeline

  • First published May 4, 2022 (1622 days ago).
  • Last revised September 10, 2026 — 1589 days after initial publication.

Remediation

Upgrade to the fixed version using your package manager.

Go
Update github.com/fluxcd/flux2 to 0.29.0 or later
go get github.com/fluxcd/flux2@v0.29.0
Go
Update github.com/fluxcd/kustomize-controller to 0.24.0 or later
go get github.com/fluxcd/kustomize-controller@v0.24.0

After upgrading, run your dependency scanner again to confirm the vulnerability is resolved.

Affected Packages (2)

Affects 1 ecosystem: go (2).

PackageEcosystemAffectedFixed In
github.com/fluxcd/flux2
go
All versions0.29.0
github.com/fluxcd/kustomize-controller
go
All versions0.24.0

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 9.9 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Changed
Confidentiality
High
Integrity
High
Availability
High

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

Frequently Asked Questions

What is CVE-2022-24877?
Improper path handling in kustomization files allows path traversal This vulnerability has been assigned a severity rating of CRITICAL (CVSS score: 9.9/10).
How do I check if my project is affected by CVE-2022-24877?
CVE-2022-24877 affects github.com/fluxcd/flux2 and github.com/fluxcd/kustomize-controller. Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2022-24877 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
9.9

Exploitation is straightforward and causes maximum impact. Patch immediately.

Also Known As

GHSA-j77r-2fxf-5jrw
BIT-flux-2022-24877
BIT-kustomize-2022-24877
GO-2022-0447

Related CVEs

Check if you're affected

Scan your dependencies to see if this vulnerability affects your projects.

Scan Your Dependencies