CVE-2022-36035 Flux CLI Workload Injection
Attackers can inject arbitrary content into Kubernetes deployments via path traversal in Flux CLI, potentially leading to code execution or privilege escalation.
- Exploited in the wild
- Not known
- Login needed
- An administrator
- Attackable
- Local or same network only
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is CVE-2022-36035?
CVE-2022-36035 is a high-severity path traversal vulnerability in fluxcd flux2, published on 31 Aug 2022. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.
Official description
Flux is a tool for keeping Kubernetes clusters in sync with sources of configuration (like Git repositories), and automating updates to configuration when there is new code to deploy. Flux CLI allows users to deploy Flux components into a Kubernetes cluster via command-line. The vulnerability allows other applications to replace the Flux deployment information with arbitrary content which is deployed into the target Kubernetes cluster instead. The vulnerability is due to the improper handling of user-supplied input, which results in a path traversal that can be controlled by the attacker. Users sharing the same shell between other applications and the Flux CLI commands could be affected by this vulnerability. In some scenarios no errors may be presented, which may cause end users not to realize that something is amiss. A safe workaround is to execute Flux CLI in ephemeral and isolated shell environments, which can ensure no persistent values exist from previous processes. However, upgrading to the latest version of the CLI is still the recommended mitigation strategy.
Weakness: CWE-22
Which versions are affected by CVE-2022-36035?
4 open source packages ship an affected version, including github.com/fluxcd/flux2 and flux. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
github.com/fluxcd/flux2 Go | From 0.21.0 | 0.32.0 |
github.com/fluxcd/flux2 Go | From 0.21.0 | 0.32.0 |
github.com/fluxcd/flux2 Go | From 0.21.0 | 0.32.0 |
flux Bitnami | From 0.21.0 | 0.32.0 |
Products include Fluxcd Flux2.
How do I fix CVE-2022-36035?
Upgrade github.com/fluxcd/flux2 to 0.32.0 or later.
Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.
Is CVE-2022-36035 being exploited?
There is no known exploitation of CVE-2022-36035 in the wild and no public exploit code.
Other vulnerabilities in fluxcd flux2
- CVE-2022-24817 Improper kubeconfig validation allows arbitrary code execution
- CVE-2022-24877 Improper path handling in kustomization files allows path traversal
- CVE-2022-36049 Flux2 Helm Controller denial of service
- CVE-2022-24878 Improper path handling in Kustomization files allows for denial of service
- CVE-2022-39272 Flux2 vulnerable to Denial of Service due to Improper use of metav1.Duration
Sources
Also known as BIT-flux-2022-36035, GHSA-xwf3-6rgv-939r, GO-2022-0960.