Skip to content

Capsule vulnerable to privilege escalation by ServiceAccount deployed in a Tenant Namespace

High severity GitHub Reviewed Published Dec 2, 2022 in projectcapsule/capsule • Updated Jan 31, 2023

Package

gomod github.com/clastix/capsule (Go)

Affected versions

<= 0.1.2

Patched versions

0.1.3

Description

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:

References

@prometherion prometherion published to projectcapsule/capsule Dec 2, 2022
Published by the National Vulnerability Database Dec 2, 2022
Published to the GitHub Advisory Database Dec 5, 2022
Reviewed Dec 5, 2022
Last updated Jan 31, 2023

Severity

High

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
Unchanged
Confidentiality
High
Integrity
High
Availability
High

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

EPSS score

0.139%
(51st percentile)

Weaknesses

CVE ID

CVE-2022-46167

GHSA ID

GHSA-x45c-cvp8-q4fm

Source code

Credits

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