Skip to content

Improper use of metav1.Duration allows for Denial of Service

Moderate severity GitHub Reviewed Published Oct 19, 2022 in fluxcd/flux2 • Updated May 20, 2024

Package

gomod github.com/fluxcd/flux2 (Go)

Affected versions

>= 0.1.0, < 0.35.0

Patched versions

0.35.0
gomod github.com/fluxcd/helm-controller (Go)
>= 0.0.1-alpha-1, < 0.24.0
0.24.0
gomod github.com/fluxcd/helm-controller/api (Go)
< 0.26.0
0.26.0
gomod github.com/fluxcd/image-automation-controller (Go)
>= 0.1.0, < 0.26.0
0.26.0
gomod github.com/fluxcd/image-automation-controller/api (Go)
< 0.26.1
0.26.1
gomod github.com/fluxcd/image-reflector-controller (Go)
>= 0.1.0, < 0.22.0
0.22.0
gomod github.com/fluxcd/image-reflector-controller/api (Go)
< 0.22.1
0.22.1
gomod github.com/fluxcd/kustomize-controller (Go)
>= 0.0.1-alpha-1, < 0.29.0
0.29.0
gomod github.com/fluxcd/kustomize-controller/api (Go)
< 0.30.0
0.30.0
gomod github.com/fluxcd/notification-controller (Go)
>= 0.0.1-alpha-1, < 0.27.0
0.27.0
gomod github.com/fluxcd/notification-controller/api (Go)
< 0.28.0
0.28.0
gomod github.com/fluxcd/source-controller (Go)
>= 0.0.1-alpha-1, < 0.30.0
0.30.0
gomod github.com/fluxcd/source-controller/api (Go)
< 0.30.0
0.30.0

Description

Flux controllers within the affected versions range are vulnerable to a denial of service attack. Users that have permissions to change Flux’s objects, either through a Flux source or directly within a cluster, can provide invalid data to fields .spec.interval or .spec.timeout (and structured variations of these fields), causing the entire object type to stop being processed.

The issue has two root causes: a) the Kubernetes type metav1.Duration not being fully compatible with the Go type time.Duration as explained on upstream report; b) lack of validation within Flux to restrict allowed values.

Workarounds

Admission controllers can be employed to restrict the values that can be used for fields .spec.interval and .spec.timeout, however upgrading to the latest versions is still the recommended mitigation.

Credits

This issue was reported by Alexander Block (@codablock) through the Flux security mailing list (as recommended).

For more information

If you have any questions or comments about this advisory:

  • Open an issue in any of the affected repositories.
  • Contact us at the CNCF Flux channel.

References

References

@hiddeco hiddeco published to fluxcd/flux2 Oct 19, 2022
Published to the GitHub Advisory Database Oct 19, 2022
Reviewed Oct 19, 2022
Published by the National Vulnerability Database Oct 22, 2022
Last updated May 20, 2024

Severity

Moderate

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

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

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:N/I:N/A:L

EPSS score

0.076%
(34th percentile)

Weaknesses

CVE ID

CVE-2022-39272

GHSA ID

GHSA-f4p5-x4vc-mh4v

Source code

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.