Skip to main content
Menu
Advisories

Fine-grained project users on LXD 5.21 can create resources in the default project, bypassing project isolation (host root via raw.dnsmasq)

GHSA-5GR7-4H6H-98W4Published Updated GitHub

Description

Reported from Incus. This advisory was copied from the Incus advisory GHSA-jcw9-v2ff-8m79.

On LXD 5.21 LTS (stable-5.21), resource-creation endpoints authorize requests against the requested project rather than the effective project. When a project has a features.* flag disabled (for example the default features.networks=false), the resource is created in the default project instead. A fine-grained authorization (OpenFGA) identity holding a can_create_* entitlement on that project can therefore create resources in default without holding any permissions on default, violating LXD's documented isolation guarantee for fine-grained authorization.

LXD main and stable-6 (6.x) are not affected.

Impact

On LXD 5.21 LTS (stable-5.21), a user authenticated through fine-grained authorization (such as an OIDC or fine-grained TLS identity) with a create entitlement on a project whose matching features.* flag is disabled can create resources in the unrestricted default project:

  • Networks (host root). When features.networks=false (the default for new projects), a user with can_create_networks (e.g. via the operator or network_manager role) on that project can create a bridge network in default with raw.dnsmasq. The raw.dnsmasq value is written verbatim into the dnsmasq configuration and loaded via --conf-file, and setting it skips dnsmasq AppArmor confinement. Setting leasefile-ro with dhcp-script=<path> causes dnsmasq to execute the script as root at startup without requiring any container or DHCP lease, resulting in full host root compromise.
  • Other inherited resource types (project isolation bypass). The same effective-project authorization gap exists on the creation endpoints for network ACLs, network zones, profiles, custom storage volumes, storage buckets, images, and image aliases, allowing a fine-grained user to create objects in default without holding create permissions on default.

(Note: The `block.create_options` and `restricted.storage-pools.access` behaviors mentioned in the upstream Incus advisory do not exist in LXD.)

Affected and unaffected versions

  • Affected: LXD 5.21 LTS (stable-5.21, >= 5.21.0) when using fine-grained authorization (OpenFGA).
  • Unaffected — main and stable-6 (6.x): Resource-creation access handlers already resolve the effective project before checking permissions, so fine-grained authorization (OpenFGA) denies creation in default unless the caller holds the entitlement on default.
  • Unaffected — restricted TLS certificates (main, stable-6, stable-5.21, stable-5.0) and stable-4.0: For legacy restricted TLS certificates (without fine-grained authorization), creating, editing, and deleting inherited resources in default when features.* is disabled is documented behavior — multi-tenant environments not using fine-grained authorization must enable all features.* flags on projects. stable-5.0 and stable-4.0 do not have OpenFGA fine-grained authorization.

Workarounds

  • Enable all relevant features.* flags (in particular features.networks=true, which also requires features.profiles=true) on projects used by fine-grained authorization identities, or do not grant can_create_* entitlements (such as can_create_networks or the operator role) on projects where the corresponding features.* flag is disabled.
  • Operators can audit the default project for unexpected resources created by tenant identities, in particular bridge networks carrying raw.dnsmasq.

Affected versions

References

GitHub · canonical/lxd