CVE-2022-39272: Improper use of metav1.Duration allows for Denial of Service in Flux Controllers

Summary

28/10/2022
Yes i
Unrated
Not published

CVE-2022-39272: Denial of service in flux controllers in github.com/fluxcd modules. Affects github.com/fluxcd/helm-controller/api versions < 0.26.0. Fixed in 0.26.0. How to fix ↓

Also tracked for

The same CVE-2022-39272 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

Free scan

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.

Check my app free

No signup required · Results in about 60 seconds

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

Flux is an open-source tool that provides a declarative approach to managing Kubernetes resources. It allows users to automate the deployment and synchronization of container images and configuration files. Flux controllers, including source-controller, kustomize-controller, helm-controller, notification-controller, image-automation-controller, and image-reflector-controller, are components of Flux that handle specific tasks within the Kubernetes cluster.

Vulnerability Detail

Flux controllers within the affected versions range are vulnerable to a denial of service attack. Users with permissions to modify Flux's objects can exploit this vulnerability by providing invalid data to fields .spec.interval or .spec.timeout, causing the entire object type to stop being processed. The vulnerability stems from the incompatibility between the Kubernetes type metav1.Duration and the Go type time.Duration, as well as the lack of validation within Flux to restrict allowed values. This issue can lead to disruption of Flux operations and potentially impact the availability of the Kubernetes cluster.

How To Fix

Minimum fixed version

0.26.0

This is the first release that contains the fix.

go get github.com/fluxcd/helm-controller/api@v0.26.0

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

To implement an admission controller workaround, you can configure a validating admission webhook that intercepts requests to modify Flux objects and enforces restrictions on the values of the .spec.interval and .spec.timeout fields. This can be done by validating the incoming data against a predefined set of allowed values or by implementing custom logic to handle the validation. The specific implementation details will depend on the Kubernetes cluster setup and the admission controller framework being used.

Conclusion

The vulnerability in Flux controllers can be mitigated by upgrading to the latest versions or implementing an admission controller workaround. It is important to ensure compatibility with the correct types and validate the values of the vulnerable fields to prevent the exploitation of this vulnerability. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for github.com/fluxcd/helm-controller/api →

Share this vulnerability

FAQ

Flux is an open-source tool that provides a declarative approach to managing Kubernetes resources. It automates the deployment and synchronization of container images and configuration files.

Flux controllers are components of Flux that handle specific tasks within the Kubernetes cluster. They include source-controller, kustomize-controller, helm-controller, notification-controller, image-automation-controller, and image-reflector-controller.

This vulnerability allows users with permissions to modify Flux's objects to disrupt Flux operations by providing invalid data to certain fields. This can lead to the entire object type being stopped from processing, potentially impacting the availability of the Kubernetes cluster.

The recommended mitigation is to upgrade to the latest versions of the affected Flux controllers. This ensures compatibility with the correct types and includes validation to prevent the use of invalid values.

Yes, an admission controller can be implemented to restrict the values that can be used for the vulnerable fields. This can be done by validating the incoming data against a predefined set of allowed values or by implementing custom logic to handle the validation.

How To Fix

Minimum fixed version

0.26.0

This is the first release that contains the fix.

go get github.com/fluxcd/helm-controller/api@v0.26.0

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback