Vulnerabilities in pkg:golang/github.com/fluxcd/helm-controller/api

PACKAGE
Advisory Identifier: GHSA-f4p5-x4vc-mh4v
Advisory Summary

CVE-2022-39272 is a MODERATE (CVSS 5.0) denial of service vulnerability (CWE-20: Improper Input Validation) affecting Github.com/fluxcd/flux2 libraries in the Go ecosystem. The issue involves improper use of metav1.duration allows for denial of service. Remediation is available by upgrading affected packages to version 0.35.0, 0.30.0, 0.29.0, 0.24.0, 0.27.0, 0.26.0, 0.22.0, 0.26.1, 0.22.1, 0.28.0.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:golang/github.com/fluxcd/helm-controller/api

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:golang/github.com/fluxcd/helm-controller/api. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-f4p5-x4vc-mh4v CVE-2022-39272 MODERATE Improper use of metav1.Duration allows for Denial of Service

CVE-2022-39272 at a Glance

CVE Identifier CVE-2022-39272
GHSA Identifier GHSA-f4p5-x4vc-mh4v
Severity MODERATE
CVSS v3.1 Base Score 5.0
CWE Classification CWE-20: Improper Input Validation
Affected Product Github.com/fluxcd/flux2
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 5.0

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:N/I:N/A:L).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality None (C:N)
Integrity None (I:N)
Availability Low (A:L)

How to Fix CVE-2022-39272

To remediate this vulnerability, upgrade all affected Github.com/fluxcd/flux2 dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/fluxcd/flux2 fixed: 0.35.0
Upgrade github.com/fluxcd/flux2 to 0.35.0
github.com/fluxcd/source-controller fixed: 0.30.0
Upgrade github.com/fluxcd/source-controller to 0.30.0
github.com/fluxcd/kustomize-controller fixed: 0.29.0
Upgrade github.com/fluxcd/kustomize-controller to 0.29.0
github.com/fluxcd/helm-controller fixed: 0.24.0
Upgrade github.com/fluxcd/helm-controller to 0.24.0
github.com/fluxcd/notification-controller fixed: 0.27.0
Upgrade github.com/fluxcd/notification-controller to 0.27.0
github.com/fluxcd/image-automation-controller fixed: 0.26.0
Upgrade github.com/fluxcd/image-automation-controller to 0.26.0
github.com/fluxcd/image-reflector-controller fixed: 0.22.0
Upgrade github.com/fluxcd/image-reflector-controller to 0.22.0
github.com/fluxcd/helm-controller/api fixed: 0.26.0
Upgrade github.com/fluxcd/helm-controller/api to 0.26.0
github.com/fluxcd/image-automation-controller/api fixed: 0.26.1
Upgrade github.com/fluxcd/image-automation-controller/api to 0.26.1
github.com/fluxcd/image-reflector-controller/api fixed: 0.22.1
Upgrade github.com/fluxcd/image-reflector-controller/api to 0.22.1
github.com/fluxcd/kustomize-controller/api fixed: 0.30.0
Upgrade github.com/fluxcd/kustomize-controller/api to 0.30.0
github.com/fluxcd/notification-controller/api fixed: 0.28.0
Upgrade github.com/fluxcd/notification-controller/api to 0.28.0
github.com/fluxcd/source-controller/api fixed: 0.30.0
Upgrade github.com/fluxcd/source-controller/api to 0.30.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/fluxcd/flux2

How to Check if You Are Affected

To determine whether your application is affected by CVE-2022-39272, inspect your project dependencies for Github.com/fluxcd/flux2:

inspect dependencies for github.com/fluxcd/flux2

Analyze the terminal output to locate any version of Github.com/fluxcd/flux2 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.35.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. In Github.com/fluxcd/flux2, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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](https://github.com/kubernetes/apimachinery/issues/131); 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](https://fluxcd.io/security/#report-a-vulnerability)). ### 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 - https://github.com/kubernetes/apimachinery/issues/131

CVE-2022-39272 Affected Github.com/fluxcd/flux2 Versions

13 component(s)
Fixed Versions:
0.35.00.30.00.29.00.24.00.27.00.26.00.22.00.26.10.22.10.28.0
Product / Package Ecosystem Affected Versions Fixed Version
github.com/fluxcd/flux2
Go
≥ 0.1.0
< 0.35.0
0.35.0
github.com/fluxcd/source-controller
Go
≥ 0.0.1-alpha-1
< 0.30.0
0.30.0
github.com/fluxcd/kustomize-controller
Go
≥ 0.0.1-alpha-1
< 0.29.0
0.29.0
github.com/fluxcd/helm-controller
Go
≥ 0.0.1-alpha-1
< 0.24.0
0.24.0
github.com/fluxcd/notification-controller
Go
≥ 0.0.1-alpha-1
< 0.27.0
0.27.0
github.com/fluxcd/image-automation-controller
Go
≥ 0.1.0
< 0.26.0
0.26.0
github.com/fluxcd/image-reflector-controller
Go
≥ 0.1.0
< 0.22.0
0.22.0
github.com/fluxcd/helm-controller/api
Go
< 0.26.0
0.26.0
github.com/fluxcd/image-automation-controller/api
Go
< 0.26.1
0.26.1
github.com/fluxcd/image-reflector-controller/api
Go
< 0.22.1
0.22.1
github.com/fluxcd/kustomize-controller/api
Go
< 0.30.0
0.30.0
github.com/fluxcd/notification-controller/api
Go
< 0.28.0
0.28.0
github.com/fluxcd/source-controller/api
Go
< 0.30.0
0.30.0

References

Frequently Asked Questions

What is CVE-2022-39272?
CVE-2022-39272 is a security vulnerability in Github.com/fluxcd/flux2 involving Improper use of metav1.Duration allows for Denial of Service under CWE-20: Improper Input Validation.
Which Github.com/fluxcd/flux2 versions are affected?
Affected versions include releases prior to 0.35.0, 0.30.0, 0.29.0, 0.24.0, 0.27.0, 0.26.0, 0.22.0, 0.26.1, 0.22.1, 0.28.0 across affected packages: github.com/fluxcd/flux2, github.com/fluxcd/source-controller, github.com/fluxcd/kustomize-controller, github.com/fluxcd/helm-controller, github.com/fluxcd/notification-controller, github.com/fluxcd/image-automation-controller, github.com/fluxcd/image-reflector-controller, github.com/fluxcd/helm-controller/api, github.com/fluxcd/image-automation-controller/api, github.com/fluxcd/image-reflector-controller/api, github.com/fluxcd/kustomize-controller/api, github.com/fluxcd/notification-controller/api, github.com/fluxcd/source-controller/api.
What version fixes CVE-2022-39272?
Upgrading to 0.35.0, 0.30.0, 0.29.0, 0.24.0, 0.27.0, 0.26.0, 0.22.0, 0.26.1, 0.22.1, 0.28.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/fluxcd/flux2 affected?
Yes, github.com/fluxcd/flux2 is affected in releases prior to 0.35.0. Upgrade your dependency to 0.35.0 or later.
Is github.com/fluxcd/source-controller affected?
Yes, github.com/fluxcd/source-controller is affected in releases prior to 0.30.0. Upgrade your dependency to 0.30.0 or later.
What is the CVSS score of CVE-2022-39272?
CVE-2022-39272 has a CVSS v3.1 base score of 5.0 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:N/I:N/A:L.
What CWE is associated with CVE-2022-39272?
CVE-2022-39272 is classified under CWE-20: Improper Input Validation (The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.).
How can I check Go dependencies for CVE-2022-39272?
Run the dependency tree command: 'inspect dependencies for github.com/fluxcd/flux2'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-f4p5-x4vc-mh4v",
  "modified" : "2024-05-20T21:35:10Z",
  "published" : "2022-10-19T18:40:02Z",
  "aliases" : [ "CVE-2022-39272" ],
  "summary" : "Improper use of metav1.Duration allows for Denial of Service",
  "details" : "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.\n\nThe 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](https://github.com/kubernetes/apimachinery/issues/131); b) lack of validation within Flux to restrict allowed values.\n\n### Workarounds\n\nAdmission 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.\n\n### Credits\n\nThis issue was reported by Alexander Block (@codablock) through the Flux security mailing list (as [recommended](https://fluxcd.io/security/#report-a-vulnerability)).\n\n### For more information\n\nIf you have any questions or comments about this advisory:\n\n- Open an issue in any of the affected repositories.\n- Contact us at the CNCF Flux channel.\n\n### References\n\n- https://github.com/kubernetes/apimachinery/issues/131\n\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:N/I:N/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/fluxcd/flux2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.1.0"
      }, {
        "fixed" : "0.35.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/fluxcd/source-controller"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.0.1-alpha-1"
      }, {
        "fixed" : "0.30.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/fluxcd/kustomize-controller"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.0.1-alpha-1"
      }, {
        "fixed" : "0.29.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/fluxcd/helm-controller"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.0.1-alpha-1"
      }, {
        "fixed" : "0.24.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/fluxcd/notification-controller"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.0.1-alpha-1"
      }, {
        "fixed" : "0.27.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/fluxcd/image-automation-controller"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.1.0"
      }, {
        "fixed" : "0.26.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/fluxcd/image-reflector-controller"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.1.0"
      }, {
        "fixed" : "0.22.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/fluxcd/helm-controller/api"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.26.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/fluxcd/image-automation-controller/api"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.26.1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/fluxcd/image-reflector-controller/api"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.22.1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/fluxcd/kustomize-controller/api"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.30.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/fluxcd/notification-controller/api"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.28.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/fluxcd/source-controller/api"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.30.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/fluxcd/flux2/security/advisories/GHSA-f4p5-x4vc-mh4v"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-39272"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/kubernetes/apimachinery/issues/131"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/fluxcd/helm-controller/pull/533"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/fluxcd/image-automation-controller/pull/439"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/fluxcd/image-reflector-controller/pull/314"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/fluxcd/kustomize-controller/pull/731"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/fluxcd/notification-controller/pull/420"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/fluxcd/source-controller/pull/903"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/fluxcd/flux2"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/kubernetes/apimachinery#131"
  }, {
    "type" : "WEB",
    "url" : "https://pkg.go.dev/vuln/GO-2022-1071"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-20" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-10-19T18:40:02Z",
    "nvd_published_at" : "2022-10-22T00:15:00Z"
  }
}