CVE-2022-46167: Github.com/clastix/capsule Capsule Vulnerable To Privilege Escalation Vulnerability

HIGH
Advisory Identifier: GHSA-x45c-cvp8-q4fm
CVSS 8.8
CWE-863
Published
Advisory Summary

CVE-2022-46167 is a HIGH (CVSS 8.8) capsule vulnerable to privilege escalation vulnerability (CWE-863: Incorrect Authorization) affecting Github.com/clastix/capsule libraries in the Go ecosystem. The issue involves capsule vulnerable to privilege escalation by serviceaccount deployed in a tenant namespace. Remediation is available by upgrading affected packages to version 0.1.3.

CVE-2022-46167 at a Glance

CVE Identifier CVE-2022-46167
GHSA Identifier GHSA-x45c-cvp8-q4fm
Severity HIGH
CVSS v3.1 Base Score 8.8
CWE Classification CWE-863: Incorrect Authorization
Affected Product Github.com/clastix/capsule
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 8.8

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:H/A:H).

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 High (I:H)
Availability High (A:H)

How to Fix CVE-2022-46167

To remediate this vulnerability, upgrade all affected Github.com/clastix/capsule 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/clastix/capsule fixed: 0.1.3
Upgrade github.com/clastix/capsule to 0.1.3
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/clastix/capsule

How to Check if You Are Affected

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

inspect dependencies for github.com/clastix/capsule

Analyze the terminal output to locate any version of Github.com/clastix/capsule in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.1.3), 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-863: Incorrect Authorization, where the product performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check. In Github.com/clastix/capsule, 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

Capsule implements a multi-tenant and policy-based environment in a Kubernetes cluster. A ServiceAccount deployed in a Tenant Namespace, when granted with `PATCH` capabilities on its own Namespace, is able to edit it and remove the Owner Reference, breaking the reconciliation of the Capsule Operator and removing all the enforcement like Pod Security annotations, Network Policies, Limit Range and Resource Quota items. With that said, an attacker could detach the Namespace from a Tenant that is forbidding starting privileged Pods using the Pod Security labels by removing the OwnerReference, removing the enforcement labels, and being able to start privileged containers that would be able to start a generic Kubernetes privilege escalation. ### Patches Patches have been released for version 0.1.3 and all users must upgrade to this release. ### Workarounds N.A. ### References N.A. ### For more information If you have any questions or comments about this advisory: * Open an issue in [github.com/clastix/capsule](https://github.com/clastix/capsule) * Reach out on [#capsule](https://kubernetes.slack.com/archives/C03GETTJQRL) channel available on Kubernetes Slack workspace

CVE-2022-46167 Affected Github.com/clastix/capsule Versions

1 component(s)
Fixed Versions:
0.1.3
Product / Package Ecosystem Affected Versions Fixed Version
github.com/clastix/capsule
Go
< 0.1.3
0.1.3

References

Frequently Asked Questions

What is CVE-2022-46167?
CVE-2022-46167 is a security vulnerability in Github.com/clastix/capsule involving Capsule vulnerable to privilege escalation by ServiceAccount deployed in a Tenant Namespace under CWE-863: Incorrect Authorization.
Which Github.com/clastix/capsule versions are affected?
Affected versions include releases prior to 0.1.3 across affected packages: github.com/clastix/capsule.
What version fixes CVE-2022-46167?
Upgrading to 0.1.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/clastix/capsule affected?
Yes, github.com/clastix/capsule is affected in releases prior to 0.1.3. Upgrade your dependency to 0.1.3 or later.
What is the CVSS score of CVE-2022-46167?
CVE-2022-46167 has a CVSS v3.1 base score of 8.8 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2022-46167?
CVE-2022-46167 is classified under CWE-863: Incorrect Authorization (The product performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check.).
How can I check Go dependencies for CVE-2022-46167?
Run the dependency tree command: 'inspect dependencies for github.com/clastix/capsule'. 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-x45c-cvp8-q4fm",
  "modified" : "2022-12-06T16:20:39Z",
  "published" : "2022-12-05T23:08:37Z",
  "aliases" : [ "CVE-2022-46167" ],
  "summary" : "Capsule vulnerable to privilege escalation by ServiceAccount deployed in a Tenant Namespace",
  "details" : "Capsule implements a multi-tenant and policy-based environment in a Kubernetes cluster. A ServiceAccount deployed in a Tenant Namespace, when granted with `PATCH` capabilities on its own Namespace, is able to edit it and remove the Owner Reference, breaking the reconciliation of the Capsule Operator and removing all the enforcement like Pod Security annotations, Network Policies, Limit Range and Resource Quota items.\n\nWith that said, an attacker could detach the Namespace from a Tenant that is forbidding starting privileged Pods using the Pod Security labels by removing the OwnerReference, removing the enforcement labels, and being able to start privileged containers that would be able to start a generic Kubernetes privilege escalation.\n\n### Patches\n\nPatches have been released for version 0.1.3 and all users must upgrade to this release.\n\n### Workarounds\n\nN.A.\n\n### References\n\nN.A.\n\n### For more information\n\nIf you have any questions or comments about this advisory:\n* Open an issue in [github.com/clastix/capsule](https://github.com/clastix/capsule)\n* Reach out on [#capsule](https://kubernetes.slack.com/archives/C03GETTJQRL) channel available on Kubernetes Slack workspace\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/clastix/capsule"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.1.3"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.1.2"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/clastix/capsule/security/advisories/GHSA-x45c-cvp8-q4fm"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-46167"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/clastix/capsule/commit/1df430e71be8c4778c82eca3459978ad7d0b4b7b"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/clastix/capsule/commit/75525ac19254b0c5111e34d7985e2be7bc8b1ac1"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/clastix/capsule"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/clastix/capsule/releases/tag/v0.1.3"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-863" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-12-05T23:08:37Z",
    "nvd_published_at" : "2022-12-02T19:15:00Z"
  }
}