Summary
A critical authorization weakness in nebula-mesh allows many /api/v1/* endpoints to trust only the bearer token, without enforcing per-certificate-authority (CA) ownership checks.
In deployments that use per-operator CAs, any non-admin operator API key can gain broad cross-tenant access, potentially resulting in immediate privilege escalation and unauthorized control over VPN hosts and policies.
Affected context
This vulnerability appears in nebula-mesh's self-hosted control plane API, specifically under the /api/v1/* route surface.
It affects environments where:
- Nebula-mesh uses a per-operator CA model for multi-tenant separation
- Operators are issued bearer tokens or API keys for automation or integration
- The Web UI is not the only management interface, and APIs are called directly by tooling or scripts
The issue primarily concerns host, network, firewall, mobile-bundle, and most operator endpoints that do not consistently enforce CA-level access controls.
Exploit preconditions
- Attack surface: HTTP(S) API under
/api/v1/*, reachable wherever the control plane is exposed (often internal or admin networks, but sometimes over the internet in misconfigured setups). - Required access: Possession of any valid non-admin operator bearer token (API key) for the nebula-mesh deployment.
- Trigger point: Invoking affected API routes (e.g., host or firewall management) that lack per-CA authorization checks while including the attacker-controlled bearer token in the Authorization header.
- Why exploitation is possible: The API layer relies solely on the presence and validity of the bearer token for authorization on many endpoints; it does not consistently verify that the calling operator is associated with the target CA or tenant, allowing cross-tenant actions by any authenticated operator.
Why this happens
The root cause is a missing authorization control at the API layer, mapped to CWE-862: Missing Authorization.
While the Web UI adds a loadAccessibleCA gate and certain CA-management endpoints enforce canAccessCA, many /api/v1/* routes for hosts, networks, firewalls, mobile bundles, and operators omit equivalent checks.
This architectural gap means that authentication (verifying who the caller is) is performed, but fine-grained authorization (verifying what the caller is allowed to do in relation to a specific CA or tenant) is not consistently enforced.
The underlying pattern is a separation between web and API authorization logic, where trust in bearer tokens is overextended and not constrained by resource-level or tenant-level policies.
Potential impact
- Any non-admin operator token may gain cross-tenant visibility and control over resources belonging to other operators or CAs.
- Attackers can potentially add, modify, or delete hosts, networks, and firewall rules across tenants.
- VPN topology and routing configurations could be altered, disrupting service or enabling traffic interception.
- Unauthorized issuance or distribution of mobile bundles could expose VPN credentials to additional parties.
- In multi-tenant environments, compromise of a single operator account could cascade into full control over the control-plane and associated VPN infrastructure.
General mitigation guidance
Effective mitigation centers on consistent, defense-in-depth authorization at the API tier:
- Introduce a unified authorization layer that evaluates each request against tenant/CA ownership before any state change is applied, regardless of entry point (Web or API).
- Enforce resource-scoped permissions such that tokens are tied to explicit CA and tenant contexts, and all API handlers validate those contexts for every operation.
- Normalize authorization checks by using shared middleware or policy helpers rather than duplicating logic across handlers, reducing the chance of "forgotten" checks.
- Apply the principle of least privilege to operator tokens, granting only the minimal actions necessary and scoping tokens tightly to specific CAs or projects.
- Design APIs to be secure-by-default: new endpoints should automatically inherit standard authz middleware instead of relying on manual integration.
- Complement access control with robust audit logging for sensitive operations (e.g., host registration, firewall changes) to detect anomalous cross-tenant activity.
How teams detect issues like this
Detection can focus on both code-level and runtime indicators:
- Static analysis and code review:
- Flag API handlers that authenticate requests but do not call shared authorization helpers (e.g., missing
canAccessCAequivalents). - Search for routes under
/api/v1/*that perform state changes or return tenant-specific data without referencing CA or tenant context checks. - Enforce architectural policies via linters or custom CI checks that ensure all handlers register standard authz middleware.
- Runtime monitoring and logging:
- Enable detailed access logs that include operator identity, CA/tenant identifiers, and target resources for each API call.
- Alert on patterns where a single operator accesses resources belonging to multiple CAs or tenants unexpectedly.
- Use anomaly detection on management actions (e.g., large numbers of cross-tenant host modifications).
- Automated testing:
- Add authorization regression tests that attempt cross-tenant operations with non-admin tokens and verify they fail.
- Use security-focused integration tests or API fuzzers configured with diverse operator tokens to validate separation between CAs.

