Severity:

CRITICAL RISK

(9.9)

Improper Authorization in Juju Controller CloudSpec API

CVE-2026-5412

Analyzed

Vulnerability type

Category:

Improper Authorization

CWE:

CWE-285

Impact:

Exposure of Cloud Credentials and Privilege Escalation

Severity:

CRITICAL RISK

(9.9)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

An authorization flaw in the Juju Controller facade allows an authenticated but low-privileged user to invoke the CloudSpec API and read the cloud credentials originally used to bootstrap the controller.

When exploited, this issue can expose sensitive cloud access keys and secrets, enabling an attacker to act with elevated privileges against the underlying cloud environment.

Affected context

This vulnerability occurs in Juju controller deployments where users with limited roles can reach the Controller facade and invoke the CloudSpec API method.

It is relevant when:

  • Multiple users share access to the same Juju controller
  • Authorization checks do not sufficiently differentiate privileged controller operators from ordinary users
  • Cloud credentials used at bootstrap are treated as long-lived, high-privilege secrets for managing infrastructure

The risk is heightened in environments where these credentials map to powerful cloud roles, such as full administrative access to projects, subscriptions, or accounts.

Exploit preconditions

  • Attack surface: Juju Controller API (Controller facade / CloudSpec method)
  • Required access: Valid authenticated Juju user account with network access to the controller; no elevated or administrative role is strictly required
  • Trigger point: Invocation of the CloudSpec API method on the controller
  • Why exploitation is possible: The authorization logic for CloudSpec does not sufficiently restrict which authenticated principals are allowed to read the stored bootstrap cloud credentials, permitting access beyond the intended privilege boundary.

Why this happens

The underlying bug is an improper authorization pattern in the Controller facade around the CloudSpec API.

The method exposes sensitive cloud configuration and credentials but relies only on coarse-grained authentication or insufficient role checks, failing to enforce that only privileged controller operators can access this data.

This maps to CWE-285: Improper Authorization, where a system accepts a request without verifying that the caller has an appropriate permission set for a sensitive operation.

Abstractly, the service ties access control to "being logged in" rather than to explicit, least-privilege roles aligned with the sensitivity of the returned information.

Potential impact

  • Disclosure of cloud provider access keys, tokens, or secrets used to bootstrap the Juju controller
  • Privilege escalation from a low-privileged Juju user to a powerful cloud-level identity
  • Creation, modification, or deletion of cloud resources under the exposed credentials
  • Lateral movement into other workloads and infrastructure managed by the same cloud account
  • Potential data exfiltration from cloud services reachable with the compromised credentials

General mitigation guidance

Robust mitigation typically focuses on strengthening authorization boundaries around sensitive controller operations and minimizing the power and lifetime of stored credentials.

Common defensive patterns include:

  • Enforcing strict, role-based access control (RBAC) on all controller APIs that return secrets or cloud configuration, ensuring only explicitly privileged roles can call them.
  • Separating duties so that the credentials used for bootstrapping or provisioning carry only the minimum cloud permissions necessary, not broad administrative rights.
  • Storing cloud credentials in dedicated, hardened secret-management mechanisms and mediating access through narrowly scoped service identities rather than returning raw secrets to users.
  • Adopting short-lived, automatically rotated credentials (e.g., federated roles, service principals with limited scopes) to reduce the impact window if they are exposed.
  • Designing controller APIs to avoid returning sensitive secrets at all where possible, preferring indirect, capability-based operations over direct credential retrieval.

How teams detect issues like this

Detection efforts can combine configuration review, logging analysis, and code-level checks:

  • Code review and static analysis: Look for controller or API methods that:
  • Return cloud configuration or credentials
  • Are guarded only by "is authenticated" checks, without explicit role or permission verification

Automated static analysis or custom linters can flag patterns where sensitive data flows are controlled by weak authorization.

  • Access control audits: Periodically review RBAC policies and permission mappings for controller facades to ensure that sensitive endpoints such as CloudSpec are only callable by privileged roles.
  • Runtime monitoring and logging: Enable detailed logging for calls to APIs that expose cloud configuration.

Monitor for unusual access patterns, such as low-privileged or non-operator accounts invoking credential-related endpoints.

  • Policy enforcement: Implement security policies in CI/CD and deployment pipelines that require explicit authorization annotations or tests for any new or modified API capable of returning secrets.

Sources

SourceLink
github.comgithub.com/juju/juju/pull/22205
github.comgithub.com/juju/juju/pull/22206
github.comgithub.com/juju/juju/security/advisories/GHSA-w5fq-8965-c969

Frequently asked

questions

Exploitability is limited to environments where an attacker can obtain any authenticated Juju user account and reach the controller API.

Within that scope, the flaw can have broad impact because it exposes high-value cloud credentials.

The attacker needs a valid, low-privileged Juju user identity and network access to the controller.

No direct administrative privileges within Juju are required if the vulnerable authorization checks are present.

The safest pattern is to enforce strict, role-based authorization on the CloudSpec and similar methods, restricting them to dedicated operator or administrator roles, and to avoid returning raw cloud credentials where possible.

APIs that inherently return secrets should be treated as highly privileged operations.

Adopt a systematic access-control model where each controller endpoint is mapped to explicit permissions and least-privilege roles, and enforce that model through code review, automated tests, and policy checks.

Additionally, classify and tag APIs that handle secrets, subject them to stricter authorization rules, and regularly review logging to detect unexpected usage patterns.

Find out what's already
exploitable in your codebase.