4.9medium
BMO can expose particularly named secrets from other namespaces via BMH CRD
- Severity
- 4.9medium CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.57% (higher than 48% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-pqfh-xh7w-7h3pGO-2024-3109
Description
The Bare Metal Operator (BMO) implements a Kubernetes API for managing bare metal hosts in Metal3. The `BareMetalHost` (BMH) CRD allows the `userData`, `metaData`, and `networkData` for the provisioned host to be specified as links to Kubernetes Secrets. There are fields for both the `Name` and `Namespace` of the Secret, meaning that versions of the baremetal-operator prior to 0.8.0, 0.6.2, and 0.5.2 will read a `Secret` from any namespace. A user with access to create or edit a `BareMetalHost` can thus exfiltrate a `Secret` from another namespace by using it as e.g. the `userData` for provisioning some host (note that this need not be a real host, it could be a VM somewhere). BMO will only read a key with the name `value` (or `userData`, `metaData`, or `networkData`), so that limits the exposure somewhat. `value` is probably a pretty common key though. Secrets used by _other_ `BareMetalHost`s in different namespaces are always vulnerable. It is probably relatively unusual for anyone other than cluster administrators to have RBAC access to create/edit a `BareMetalHost`. This vulnerability is only meaningful, if the cluster has users other than administrators and users' privileges are limited to their respective namespaces. The patch prevents BMO from accepting links to Secrets from other namespaces as BMH input. Any BMH configuration is only read from the same namespace only. The problem is patched in BMO releases v0.7.0, v0.6.2 and v0.5.2 and users should upgrade to those versions. Prior upgrading, duplicate the BMC Secrets to the namespace where the corresponding BMH is. After upgrade, remove the old Secrets. As a workaround, an operator can configure BMO RBAC to be namespace scoped for Secrets, instead of cluster scoped, to prevent BMO from accessing Secrets from other namespaces.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| metal3-io baremetal-operator | >= 0.7.0, < 0.8.0, >= 0.6.0, < 0.6.2, < 0.5.2 | CVE List |
| github.com/metal3-io/baremetal-operator (Go) | from 0.7.0-rc.0 before 0.8.0, from 0.6.0 before 0.6.2, before 0.5.2 | GitHub Advisory Database, Go Vulnerability Database |
All scores
| GitHub_M | 4.9medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:N/A:N |
| GitHub | 4.9medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:N/A:N |
| GitHub | medium CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N |
Classification
What each source says
CVE List
The Bare Metal Operator (BMO) implements a Kubernetes API for managing bare metal hosts in Metal3. The `BareMetalHost` (BMH) CRD allows the `userData`, `metaData`, and `networkData` for the provisioned host to be specified as links to Kubernetes Secrets. There are fields for both the `Name` and `Namespace` of the Secret, meaning that versions of the baremetal-operator prior to 0.8.0, 0.6.2, and 0.5.2 will read a `Secret` from any namespace. A user with access to create or edit a `BareMetalHost` can thus exfiltrate a `Secret` from another namespace by using it as e.g. the `userData` for provisioning some host (note that this need not be a real host, it could be a VM somewhere). BMO will only read a key with the name `value` (or `userData`, `metaData`, or `networkData`), so that limits the exposure somewhat. `value` is probably a pretty common key though. Secrets used by _other_ `BareMetalHost`s in different namespaces are always vulnerable. It is probably relatively unusual for anyone other than cluster administrators to have RBAC access to create/edit a `BareMetalHost`. This vulnerability is only meaningful, if the cluster has users other than administrators and users' privileges are limited to their respective namespaces. The patch prevents BMO from accepting links to Secrets from other namespaces as BMH input. Any BMH configuration is only read from the same namespace only. The problem is patched in BMO releases v0.7.0, v0.6.2 and v0.5.2 and users should upgrade to those versions. Prior upgrading, duplicate the BMC Secrets to the namespace where the corresponding BMH is. After upgrade, remove the old Secrets. As a workaround, an operator can configure BMO RBAC to be namespace scoped for Secrets, instead of cluster scoped, to prevent BMO from accessing Secrets from other namespaces.
GitHub Advisory Database
Impact
The Bare Metal Operator (BMO) implements a Kubernetes API for managing bare metal hosts in Metal3. The BareMetalHost (BMH) CRD allows the userData, metaData, and networkData for the provisioned host to be specified as links to Kubernetes Secrets. There are fields for both the Name and Namespace of the Secret, meaning that the baremetal-operator will read a Secret from any namespace. A user with access to create or edit a BareMetalHost can thus exfiltrate a Secret from another namespace by using it as e.g. the userData for provisioning some host (note that this need not be a real host, it could be a VM somewhere).
Limiting factors
BMO will only read a key with the name value (or userData, metaData, or networkData), so that limits the exposure somewhat. value is probably a pretty common key though. Secrets used by other BareMetalHosts in different namespaces are always vulnerable.
It is probably relatively unusual for anyone other than cluster administrators to have RBAC access to create/edit a BareMetalHost. This vulnerability is only meaningful, if the cluster has users other than administrators and users' privileges are limited to their respective namespaces.
Patches
The patch prevents BMO from accepting links to Secrets from other namespaces as BMH input. Any BMH configuration is only read from the same namespace only.
The problem is patched in BMO releases v0.8.0, v0.6.2 and v0.5.2 and users should upgrade to those versions. Prior upgrading and if needed, duplicate the BMC Secrets to the namespace where the corresponding BMH is. After upgrade, remove the old Secrets.
Workarounds
Operator can configure BMO RBAC to be namespace scoped for Secrets, instead of cluster scoped, to prevent BMO from accessing Secrets from other namespaces.
References
Go Vulnerability Database
The Bare Metal Operator (BMO) can expose particularly named secrets from other namespaces via BMH CRD in github.com/metal3-io/baremetal-operator
NVD (es)
Bare Metal Operator (BMO) implementa una API de Kubernetes para administrar hosts de bare metal en Metal3. El CRD `BareMetalHost` (BMH) permite que `userData`, `metaData` y `networkData` para el host aprovisionado se especifiquen como enlaces a secretos de Kubernetes. Hay campos tanto para el `Name` como para el `Namespace` del secreto, lo que significa que las versiones del baremetal-operator anteriores a 0.8.0, 0.6.2 y 0.5.2 leerán un `Secret` de cualquier espacio de nombres. Un usuario con acceso para crear o editar un `BareMetalHost` puede, por lo tanto, exfiltrar un `Secret` de otro espacio de nombres al usarlo, por ejemplo, como `userData` para aprovisionar algún host (tenga en cuenta que no es necesario que sea un host real, podría ser una máquina virtual en algún lugar). BMO solo leerá una clave con el nombre `value` (o `userData`, `metaData` o `networkData`), por lo que limita un poco la exposición. `value` es probablemente una clave bastante común. Los secretos utilizados por _otros_ `BareMetalHost` en diferentes espacios de nombres siempre son vulnerables. Es probablemente relativamente inusual que alguien que no sea un administrador del clúster tenga acceso RBAC para crear o editar un `BareMetalHost`. Esta vulnerabilidad solo es significativa si el clúster tiene usuarios que no sean administradores y los privilegios de los usuarios están limitados a sus respectivos espacios de nombres. El parche evita que BMO acepte enlaces a secretos de otros espacios de nombres como entrada BMH. Cualquier configuración de BMH solo se lee desde el mismo espacio de nombres. El problema está parcheado en las versiones v0.7.0, v0.6.2 y v0.5.2 de BMO y los usuarios deben actualizar a esas versiones. Antes de actualizar, duplique los secretos de BMC en el espacio de nombres donde se encuentra el BMH correspondiente. Después de la actualización, elimine los secretos antiguos. Como solución alternativa, un operador puede configurar BMO RBAC para que tenga alcance de espacio de nombres para secretos, en lugar de alcance de clúster, para evitar que BMO acceda a secretos desde otros espacios de nombres.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2024-43803 changed 2024-09-03 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-pqfh-xh7w-7h3p changed 2024-12-20 | CC-BY-4.0 |
| Go Vulnerability Database | GO-2024-3109 changed 2026-03-03 | CC-BY-4.0 |
| NVD | CVE-2024-43803 changed 2026-06-17 | Public domain |