Логотип exploitDog
Консоль
Логотип exploitDog

exploitDog

github логотип

GHSA-6r4j-4rjc-8vw5

Опубликовано: 12 авг. 2024
Источник: github
Github: Прошло ревью
CVSS4: 9.3
CVSS3: 8.1

Описание

RBAC Roles for etcd created by Kamaji are not disjunct

Summary

Using an "open at the top" range definition in RBAC for etcd roles leads to some TCPs API servers being able to read, write and delete the data of other control planes.

Details

The problematic code is this: https://github.com/clastix/kamaji/blob/8cdc6191242f80d120c46b166e2102d27568225a/internal/datastore/etcd.go#L19-L24

The range created by this RBAC setup code looks like this:

etcdctl role get example Role example KV Read: [/example/, \0) KV Write: [/example/, \0)

The range end \0 means "everything that comes after" in etcd, so potentially all the key prefixes of controlplanes with a name that comes after "example" when sorting lexically (e.g. example1, examplf, all the way to zzzzzzz if you will).

PoC

  1. Create two TCP in the same Namespace
  2. Scale Kamaji to zero to avoid reconciliations
  3. change the Kubernetes API Server --etcd-prefix flag value to point to the other TCP datastore key
  4. wait it for get it up and running
  5. use kubectl and will notice you're reading and writing data of another Tenant

Impact

Full control over other TCPs data, if you are able to obtain the name of other TCPs that use the same datastore and are able to obtain the user certificates used by your control plane (or you are able to configure the kube-apiserver Deployment, as shown in the PoC).

Пакеты

Наименование

github.com/clastix/kamaji

go
Затронутые версииВерсия исправления

<= 1.0.0

Отсутствует

EPSS

Процентиль: 62%
0.00425
Низкий

9.3 Critical

CVSS4

8.1 High

CVSS3

Дефекты

CWE-284

Связанные уязвимости

CVSS3: 8.1
nvd
больше 1 года назад

Kamaji is the Hosted Control Plane Manager for Kubernetes. In versions 1.0.0 and earlier, Kamaji uses an "open at the top" range definition in RBAC for etcd roles leading to some TCPs API servers being able to read, write, and delete the data of other control planes. This vulnerability is fixed in edge-24.8.2.

EPSS

Процентиль: 62%
0.00425
Низкий

9.3 Critical

CVSS4

8.1 High

CVSS3

Дефекты

CWE-284