CVE-2025-29781 Bare Metal Operator (BMO) can expose any secret from other namespaces via BMCEventSubscription CRD
An attacker with namespace-level access can leak secrets from other namespaces by creating a BMCEventSubscription resource in the Metal3 Bare Metal Operator.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Local or same network only
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2025-29781?
CVE-2025-29781 is a medium-severity vulnerability in metal3-io baremetal-operator, published on 17 Mar 2025. It can only be exploited from the same machine or local network, with no action from the victim.
Official description
The Bare Metal Operator (BMO) implements a Kubernetes API for managing bare metal hosts in Metal3. Baremetal Operator enables users to load Secret from arbitrary namespaces upon deployment of the namespace scoped Custom Resource `BMCEventSubscription`. Prior to versions 0.8.1 and 0.9.1, an adversary Kubernetes account with only namespace level roles (e.g. a tenant controlling a namespace) may create a `BMCEventSubscription` in his authorized namespace and then load Secrets from his unauthorized namespaces to his authorized namespace via the Baremetal Operator, causing Secret Leakage. The patch makes BMO refuse to read Secrets from other namespace than where the corresponding BMH resource is. The patch does not change the `BMCEventSubscription` API in BMO, but stricter validation will fail the request at admission time. It will also prevent the controller reading such Secrets, in case the BMCES CR has already been deployed. The issue exists for all versions of BMO, and is patched in BMO releases v0.9.1 and v0.8.1. Prior upgrading to patched BMO version, duplicate any existing Secret pointed to by `BMCEventSubscription`'s `httpHeadersRef` to the same namespace where the corresponding BMH exists. After upgrade, remove the old Secrets. As a workaround, the operator can configure BMO RBAC to be namespace scoped, instead of cluster scoped, to prevent BMO from accessing Secrets from other namespaces, and/or use `WATCH_NAMESPACE` configuration option to limit BMO to single namespace.
Which versions are affected by CVE-2025-29781?
5 open source packages ship an affected version, including github.com/metal3-io/baremetal-operator/apis.
| Package | Affected | Fixed in |
|---|---|---|
github.com/metal3-io/baremetal-operator/apis Go | All versions | 0.8.1, 0.9.1 |
github.com/metal3-io/baremetal-operator/apis Go | All versions | 0.8.1 |
github.com/metal3-io/baremetal-operator/apis Go | All versions | 0.8.1 |
github.com/metal3-io/baremetal-operator/apis Go | From 0.9.0 | 0.9.1 |
github.com/metal3-io/baremetal-operator/apis Go | From 0.9.0 | 0.9.1 |
How do I fix CVE-2025-29781?
Upgrade github.com/metal3-io/baremetal-operator/apis to a fixed version for your release line: 0.8.1 or 0.9.1.
Is CVE-2025-29781 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-29781 exists.
Sources
Also known as GHSA-c98h-7hp9-v9hq, GO-2025-3530.