{"id":"GHSA-3g2j-vm47-x4mj","aliases":["GHSA-3g2j-vm47-x4mj","GO-2025-4121"],"related":[],"kind":"vulnerability","state":"published","title":"LXD vulnerable to a local privilege escalation through custom storage volumes","summary":"**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","summaryFormat":"markdown","summarySource":"ghsa","descriptions":[{"lang":"en","text":"**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","format":"markdown","source":"ghsa"},{"lang":"en","text":"LXD vulnerable to a local privilege escalation through custom storage volumes in lxd in github.com/canonical/lxd","format":"markdown","source":"go"}],"published":"2025-11-13T23:01:44.000Z","modified":"2025-11-18T18:40:12.000Z","severity":{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"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","rating":"HIGH"},"severities":[{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"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","rating":"HIGH"}],"cwes":["CWE-269"],"affected":[{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.0.0-20251110144034-698854d0164f"}],"ecosystem":"Go","package":"github.com/canonical/lxd","purl":"pkg:golang/github.com/canonical/lxd","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected"}],"ecosystem":"Go","package":"github.com/canonical/lxd","purl":"pkg:golang/github.com/canonical/lxd","source":"go"}],"references":[{"url":"https://github.com/canonical/lxd/security/advisories/GHSA-3g2j-vm47-x4mj","tags":["advisory","web"],"sources":["ghsa","go"]},{"url":"https://github.com/lxc/incus/security/advisories/GHSA-56mx-8g9f-5crf","tags":["web"],"sources":["ghsa","go"]},{"url":"https://github.com/lxc/incus/issues/2641","tags":["web"],"sources":["ghsa","go"]},{"url":"https://github.com/canonical/lxd/pull/16904","tags":["fix","web"],"sources":["ghsa","go"]},{"url":"https://github.com/canonical/lxd/pull/16922","tags":["fix","web"],"sources":["ghsa","go"]},{"url":"https://github.com/canonical/lxd/pull/16923","tags":["fix","web"],"sources":["ghsa","go"]},{"url":"https://github.com/canonical/lxd/pull/16924","tags":["fix","web"],"sources":["ghsa","go"]},{"url":"https://github.com/canonical/lxd","tags":["package"],"sources":["ghsa"]}],"credits":[],"sources":[{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-3g2j-vm47-x4mj","url":"https://github.com/advisories/GHSA-3g2j-vm47-x4mj","licence":"CC-BY-4.0","modified":"2025-11-18T18:40:12.000Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2025-4121","url":"https://pkg.go.dev/vuln/GO-2025-4121","licence":"CC-BY-4.0","modified":"2025-11-18T16:14:17.916Z"}],"updatedAt":"2026-11-25T22:56:24.218Z"}