GHSA-3g2j-vm47-x4mj: Github.com/canonical/lxd LXD Vulnerable To A Local Vulnerability

HIGH
CWE-269
Published
Advisory Summary

GHSA-3g2j-vm47-x4mj is a HIGH lxd vulnerable to a local vulnerability (CWE-269: Improper Privilege Management) affecting Github.com/canonical/lxd libraries in the Go ecosystem. The issue involves lxd vulnerable to a local privilege escalation through custom storage volumes. Remediation is available by upgrading affected packages to version 0.0.0-20251110144034-698854d0164f.

GHSA-3g2j-vm47-x4mj at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-3g2j-vm47-x4mj
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-269: Improper Privilege Management
Affected Product Github.com/canonical/lxd
Package Ecosystem Go
Published Date
Last Updated

How to Fix GHSA-3g2j-vm47-x4mj

To remediate this vulnerability, upgrade all affected Github.com/canonical/lxd dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/canonical/lxd fixed: 0.0.0-20251110144034-698854d0164f
Upgrade github.com/canonical/lxd to 0.0.0-20251110144034-698854d0164f
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/canonical/lxd

How to Check if You Are Affected

To determine whether your application is affected by GHSA-3g2j-vm47-x4mj, inspect your project dependencies for Github.com/canonical/lxd:

inspect dependencies for github.com/canonical/lxd

Analyze the terminal output to locate any version of Github.com/canonical/lxd in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.0.0-20251110144034-698854d0164f), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-269: Improper Privilege Management, where the product does not properly assign, modify, track, or check privileges for an actor, creating an unintended sphere of control for that actor. In Github.com/canonical/lxd, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

**Impact** This affects any LXD user in an environment where an unprivileged user may have root access to a container with an attached custom storage volume that has the `security.shifted` property set to `true` as well as access to the host as an unprivileged user. The most common case for this would be systems using `lxd-user` with the less privileged lxd group to provide unprivileged users with an isolated restricted access to LXD. Such users may be able to create a custom storage volume with the necessary property (depending on kernel and filesystem support) and can then write a setuid binary from within the container which can be executed as an unprivileged user on the host to gain root privileges. **Patches** Patches for this issue are available: - LXD 6 series: https://github.com/canonical/lxd/pull/16904 - LXD 5.21 LTS series: https://github.com/canonical/lxd/pull/16922 - LXD 5.0 LTS series: https://github.com/canonical/lxd/pull/16923 - LXD 4.0 LTS series: https://github.com/canonical/lxd/pull/16924 The first commit changes the permissions for any new storage pool, the later commit adds a patch that applies it on startup to all existing storage pools. These fixes are also available in the associated candidate snap channels for each LTS series: - 5.21/candidate (5.21.4-8a3cf61) - 5.0/candidate (5.0.5-5c60378) - 4.0/candidate (4.0.10-35a8127) We will be preparing intermediate releases to the associated stable snap channels shortly. **Workarounds** Permissions can be manually restricted until a patched version of LXD is deployed. This is done with: ``` sudo nsenter --mount=/run/snapd/ns/lxd.mnt -- chmod 0700 /var/snap/lxd/common/lxd/storage-pools/*/{custom*,virtual-machines*,images} sudo nsenter --mount=/run/snapd/ns/lxd.mnt -- chmod 0711 /var/snap/lxd/common/lxd/storage-pools/*/{containers*,buckets*} ``` Those are the same permissions which will be applied by the patched LXD for both new and existing storage pools. **References** This was reported to Incus publicly on Github here: - https://github.com/lxc/incus/security/advisories/GHSA-56mx-8g9f-5crf - https://github.com/lxc/incus/issues/2641

GHSA-3g2j-vm47-x4mj Affected Github.com/canonical/lxd Versions

1 component(s)
Fixed Versions:
0.0.0-20251110144034-698854d0164f
Product / Package Ecosystem Affected Versions Fixed Version
github.com/canonical/lxd
Go
< 0.0.0-20251110144034-698854d0164f
0.0.0-20251110144034-698854d0164f

References

Frequently Asked Questions

What is GHSA-3g2j-vm47-x4mj?
GHSA-3g2j-vm47-x4mj is a security vulnerability in Github.com/canonical/lxd involving LXD vulnerable to a local privilege escalation through custom storage volumes under CWE-269: Improper Privilege Management.
Which Github.com/canonical/lxd versions are affected?
Affected versions include releases prior to 0.0.0-20251110144034-698854d0164f across affected packages: github.com/canonical/lxd.
What version fixes GHSA-3g2j-vm47-x4mj?
Upgrading to 0.0.0-20251110144034-698854d0164f (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/canonical/lxd affected?
Yes, github.com/canonical/lxd is affected in releases prior to 0.0.0-20251110144034-698854d0164f. Upgrade your dependency to 0.0.0-20251110144034-698854d0164f or later.
What CWE is associated with GHSA-3g2j-vm47-x4mj?
GHSA-3g2j-vm47-x4mj is classified under CWE-269: Improper Privilege Management (The product does not properly assign, modify, track, or check privileges for an actor, creating an unintended sphere of control for that actor.).
How can I check Go dependencies for GHSA-3g2j-vm47-x4mj?
Run the dependency tree command: 'inspect dependencies for github.com/canonical/lxd'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-3g2j-vm47-x4mj",
  "modified" : "2025-11-18T18:40:12Z",
  "published" : "2025-11-13T23:01:44Z",
  "aliases" : [ ],
  "summary" : "LXD vulnerable to a local privilege escalation through custom storage volumes",
  "details" : "**Impact**\n\nThis affects any LXD user in an environment where an unprivileged user may have root access to a container with an attached custom storage volume that has the `security.shifted` property set to `true` as well as access to the host as an unprivileged user.\n\nThe most common case for this would be systems using `lxd-user` with the less privileged lxd group to provide unprivileged users with an isolated restricted access to LXD. Such users may be able to create a custom storage volume with the necessary property (depending on kernel and filesystem support) and can then write a setuid binary from within the container which can be executed as an unprivileged user on the host to gain root privileges.\n\n**Patches**\n\nPatches for this issue are available: \n\n- LXD 6 series: https://github.com/canonical/lxd/pull/16904\n- LXD 5.21 LTS series: https://github.com/canonical/lxd/pull/16922\n- LXD 5.0 LTS series: https://github.com/canonical/lxd/pull/16923\n- LXD 4.0 LTS series: https://github.com/canonical/lxd/pull/16924 \n\nThe first commit changes the permissions for any new storage pool, the later commit adds a patch that applies it on startup to all existing storage pools.\n\nThese fixes are also available in the associated candidate snap channels for each LTS series:\n\n- 5.21/candidate (5.21.4-8a3cf61)\n- 5.0/candidate (5.0.5-5c60378)\n- 4.0/candidate (4.0.10-35a8127)\n\nWe will be preparing intermediate releases to the associated stable snap channels shortly.\n\n**Workarounds**\n\nPermissions can be manually restricted until a patched version of LXD is deployed.\n\nThis is done with:\n\n```\nsudo nsenter --mount=/run/snapd/ns/lxd.mnt -- chmod 0700 /var/snap/lxd/common/lxd/storage-pools/*/{custom*,virtual-machines*,images}\nsudo nsenter --mount=/run/snapd/ns/lxd.mnt -- chmod 0711 /var/snap/lxd/common/lxd/storage-pools/*/{containers*,buckets*}\n```\n\nThose are the same permissions which will be applied by the patched LXD for both new and existing storage pools.\n\n**References**\n\nThis was reported to Incus publicly on Github here: \n\n- https://github.com/lxc/incus/security/advisories/GHSA-56mx-8g9f-5crf\n- https://github.com/lxc/incus/issues/2641",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/canonical/lxd"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.0.0-20251110144034-698854d0164f"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/canonical/lxd/security/advisories/GHSA-3g2j-vm47-x4mj"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/lxc/incus/security/advisories/GHSA-56mx-8g9f-5crf"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/lxc/incus/issues/2641"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/canonical/lxd/pull/16904"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/canonical/lxd/pull/16922"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/canonical/lxd/pull/16923"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/canonical/lxd/pull/16924"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/canonical/lxd"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-269" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-11-13T23:01:44Z",
    "nvd_published_at" : null
  }
}