CVE-2022-3162: Github.com/kubernetes/kubernetes Path Traversal Vulnerability

MODERATE
Advisory Identifier: GHSA-2394-5535-8j88
CVSS 6.5
CWE-23 CWE-22
Published
Advisory Summary

CVE-2022-3162 is a MODERATE (CVSS 6.5) path traversal vulnerability (CWE-23: Relative Path Traversal) affecting Github.com/kubernetes/kubernetes libraries in the Go ecosystem. The issue involves kubernetes vulnerable to path traversal. Remediation is available by upgrading affected packages to version 1.25.4, 1.24.8, 1.23.14, 1.22.16.

CVE-2022-3162 at a Glance

CVE Identifier CVE-2022-3162
GHSA Identifier GHSA-2394-5535-8j88
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification CWE-23: Relative Path Traversal
Affected Product Github.com/kubernetes/kubernetes
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 6.5

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:U/C:H/I:N/A:N).

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

How to Fix CVE-2022-3162

To remediate this vulnerability, upgrade all affected Github.com/kubernetes/kubernetes 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/kubernetes/kubernetes fixed: 1.25.4
Upgrade github.com/kubernetes/kubernetes to 1.25.4
github.com/kubernetes/kubernetes fixed: 1.24.8
Upgrade github.com/kubernetes/kubernetes to 1.24.8
github.com/kubernetes/kubernetes fixed: 1.23.14
Upgrade github.com/kubernetes/kubernetes to 1.23.14
github.com/kubernetes/kubernetes fixed: 1.22.16
Upgrade github.com/kubernetes/kubernetes to 1.22.16
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/kubernetes/kubernetes

How to Check if You Are Affected

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

inspect dependencies for github.com/kubernetes/kubernetes

Analyze the terminal output to locate any version of Github.com/kubernetes/kubernetes in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.25.4), 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-23: Relative Path Traversal, where the product uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize sequences such as ".." that can resolve to a location that is outside of that directory. In Github.com/kubernetes/kubernetes, 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

Users authorized to list or watch one type of namespaced custom resource cluster-wide can read custom resources of a different type in the same API group without authorization. Clusters are impacted by this vulnerability if all of the following are true: 1. There are 2+ CustomResourceDefinitions sharing the same API group 2. Users have cluster-wide list or watch authorization on one of those custom resources. 3. The same users are not authorized to read another custom resource in the same API group.

CVE-2022-3162 Affected Github.com/kubernetes/kubernetes Versions

4 component(s)
Fixed Versions:
1.25.41.24.81.23.141.22.16
Product / Package Ecosystem Affected Versions Fixed Version
github.com/kubernetes/kubernetes
Go
≥ 1.25.0
< 1.25.4
1.25.4
github.com/kubernetes/kubernetes
Go
≥ 1.24.0
< 1.24.8
1.24.8
github.com/kubernetes/kubernetes
Go
≥ 1.23.0
< 1.23.14
1.23.14
github.com/kubernetes/kubernetes
Go
≥ 1.22.0
< 1.22.16
1.22.16

References

Frequently Asked Questions

What is CVE-2022-3162?
CVE-2022-3162 is a security vulnerability in Github.com/kubernetes/kubernetes involving Kubernetes vulnerable to path traversal under CWE-23: Relative Path Traversal.
Which Github.com/kubernetes/kubernetes versions are affected?
Affected versions include releases prior to 1.25.4, 1.24.8, 1.23.14, 1.22.16 across affected packages: github.com/kubernetes/kubernetes.
What version fixes CVE-2022-3162?
Upgrading to 1.25.4, 1.24.8, 1.23.14, 1.22.16 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/kubernetes/kubernetes affected?
Yes, github.com/kubernetes/kubernetes is affected in releases prior to 1.25.4, 1.24.8, 1.23.14, 1.22.16. Upgrade your dependency to 1.25.4, 1.24.8, 1.23.14, 1.22.16 or later.
What is the CVSS score of CVE-2022-3162?
CVE-2022-3162 has a CVSS v3.1 base score of 6.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2022-3162?
CVE-2022-3162 is classified under CWE-23: Relative Path Traversal (The product uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize sequences such as ".." that can resolve to a location that is outside of that directory.).
How can I check Go dependencies for CVE-2022-3162?
Run the dependency tree command: 'inspect dependencies for github.com/kubernetes/kubernetes'. 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-2394-5535-8j88",
  "modified" : "2023-03-10T22:38:21Z",
  "published" : "2023-03-01T21:30:18Z",
  "aliases" : [ "CVE-2022-3162" ],
  "summary" : "Kubernetes vulnerable to path traversal",
  "details" : "Users authorized to list or watch one type of namespaced custom resource cluster-wide can read custom resources of a different type in the same API group without authorization. Clusters are impacted by this vulnerability if all of the following are true: 1. There are 2+ CustomResourceDefinitions sharing the same API group 2. Users have cluster-wide list or watch authorization on one of those custom resources. 3. The same users are not authorized to read another custom resource in the same API group.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/kubernetes/kubernetes"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.25.0"
      }, {
        "fixed" : "1.25.4"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "< 1.25.3"
    }
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/kubernetes/kubernetes"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.24.0"
      }, {
        "fixed" : "1.24.8"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/kubernetes/kubernetes"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.23.0"
      }, {
        "fixed" : "1.23.14"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/kubernetes/kubernetes"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.22.0"
      }, {
        "fixed" : "1.22.16"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-3162"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/kubernetes/kubernetes/issues/113756"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/kubernetes/kubernetes"
  }, {
    "type" : "WEB",
    "url" : "https://groups.google.com/g/kubernetes-security-announce/c/iUd550j7kjA"
  }, {
    "type" : "WEB",
    "url" : "https://security.netapp.com/advisory/ntap-20230511-0004"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22", "CWE-23" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-03-10T22:38:21Z",
    "nvd_published_at" : "2023-03-01T19:15:00Z"
  }
}