You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Security: Unauthenticated bootstrap endpoint can overwrite root keys #610
Note: This issue documents a vulnerability that was originally reported privately as the repository security advisory GHSA-f7w3-x786-xvh7 by @pbeza.
Root Cause
The KMS bootstrap endpoint has no authentication and no idempotency check. It accepts root key material (or generates it) and persists it. If called multiple times, subsequent calls can overwrite previously set root keys. During the initial KMS setup window, a race condition allows an attacker to substitute their own root keys.
Attack Path
Legitimate operator initiates KMS bootstrap
Attacker concurrently calls the bootstrap endpoint with their own root key material
If the attacker's request arrives first (or the endpoint allows overwrites), attacker's keys are persisted
All subsequent key derivations use the attacker's root keys
Attacker controls the entire key hierarchy for all CVMs using this KMS
Impact
If an attacker wins the bootstrap race, they control the root keys for the entire KMS instance. All app keys, disk encryption keys, and signing keys derived from this KMS are compromised. For MPC, all keyshares and signing keys are under attacker control.
Suggested Fix
Add authentication to the bootstrap endpoint (e.g., require a pre-shared bootstrap token)
Add idempotency: reject bootstrap if root keys are already set
Note: This finding was reported automatically as part of an AI/Claude-driven internal audit by the NEAR One MPC team. It has not been manually verified by a human to confirm whether it constitutes an actual security issue.
Maintainer response (copied from private security advisory GHSA-f7w3-x786-xvh7):
Thanks for the report, but the described attack path is not feasible.
The bootstrap endpoint does not accept external key material. The BootstrapRequest only contains a domain field — root keys are generated server-side by Keys::generate(), not supplied by the caller. An attacker cannot "substitute their own root keys" because there is no mechanism to inject key material through this endpoint.
Calling bootstrap multiple times simply regenerates keys on the server side. The operator retains the last result and chooses which bootstrap outcome to publish (e.g., registering the corresponding public key on-chain). An attacker calling bootstrap concurrently would only cause a re-generation of server-side keys — the operator can simply re-run bootstrap and publish the correct result.
As noted in our response to GHSA-fc72-qqqp-cjgr, the onboard service is a short-lived, temporary setup process. Operators concerned about interference during setup can bind the service to 127.0.0.1 or use firewall rules until configuration is complete.
Activity
kvinwang commentedon Mar 27, 2026
Maintainer response (copied from private security advisory GHSA-f7w3-x786-xvh7):
Thanks for the report, but the described attack path is not feasible.
The bootstrap endpoint does not accept external key material. The
BootstrapRequestonly contains adomainfield — root keys are generated server-side byKeys::generate(), not supplied by the caller. An attacker cannot "substitute their own root keys" because there is no mechanism to inject key material through this endpoint.Calling bootstrap multiple times simply regenerates keys on the server side. The operator retains the last result and chooses which bootstrap outcome to publish (e.g., registering the corresponding public key on-chain). An attacker calling bootstrap concurrently would only cause a re-generation of server-side keys — the operator can simply re-run bootstrap and publish the correct result.
As noted in our response to GHSA-fc72-qqqp-cjgr, the onboard service is a short-lived, temporary setup process. Operators concerned about interference during setup can bind the service to
127.0.0.1or use firewall rules until configuration is complete.