CVE-2022-24877: Path Traversal Vulnerability in github.com/fluxcd/flux2
Summary
CVE-2022-24877: Improper path handling in kustomization files allows path traversal in github.com/fluxcd/flux2. Affects github.com/fluxcd/flux2 versions < 0.29.0. Fixed in 0.29.0. How to fix ↓
Also tracked for
- flux · Bitnami
- kustomize · Bitnami
- github.com/fluxcd/kustomize-controller · Go
The same CVE-2022-24877 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
github.com/fluxcd/flux2 is a Go package that provides a tool for deploying and managing Kubernetes resources. It is used to automate the deployment of applications and services in a Kubernetes cluster. The package allows users to define and apply customizations to Kubernetes manifests using kustomization files. These files specify the desired state of the cluster and are processed by the package to generate the necessary resources. However, a vulnerability in the path handling of kustomization files can lead to path traversal attacks.
Vulnerability Detail
The vulnerability in github.com/fluxcd/flux2 allows an attacker to perform path traversal attacks by manipulating the paths specified in kustomization files. By crafting a malicious kustomization file, an attacker can traverse directories outside of the intended scope and potentially access sensitive files or execute arbitrary code. This can lead to unauthorized access, data leakage, or even remote code execution on the affected system. The vulnerability affects versions 0.0.0 up to and including 0.29.0 of github.com/fluxcd/flux2 and versions 0.0.0 up to and including 0.24.0 of github.com/fluxcd/kustomize-controller.
How To Fix
Minimum fixed version
0.29.0
This is the first release that contains the fix.
go get github.com/fluxcd/flux2@v0.29.0
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
There is no known workaround for this vulnerability. It is recommended to apply the fix by upgrading to the fixed versions of the affected packages.
Conclusion
The path traversal vulnerability in github.com/fluxcd/flux2 allows attackers to manipulate paths in kustomization files and potentially access sensitive files or execute arbitrary code. Upgrading to the fixed versions of the affected packages is necessary to mitigate the risk. It is recommended to update dependencies and deploy the updated package versions in affected environments.
See every vulnerability recorded for github.com/fluxcd/flux2 →
FAQ
github.com/fluxcd/flux2 is a Go package used for deploying and managing Kubernetes resources.
A kustomization file is used by github.com/fluxcd/flux2 to specify customizations to Kubernetes manifests.
Path traversal is a technique used by attackers to access files or directories outside of the intended scope.
The vulnerability can lead to unauthorized access, data leakage, or remote code execution on the affected system.
To fix the vulnerability, upgrade to the fixed versions of the affected packages.
Related vulnerabilities
Recent vulnerabilities recorded for github.com/fluxcd/flux2.