GHSA-3G2J-VM47-X4MJ
Vulnerability from github – Published: 2025-11-13 23:01 – Updated: 2025-11-18 18:40Impact
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
{
"affected": [
{
"package": {
"ecosystem": "Go",
"name": "github.com/canonical/lxd"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "0.0.0-20251110144034-698854d0164f"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [],
"database_specific": {
"cwe_ids": [
"CWE-269"
],
"github_reviewed": true,
"github_reviewed_at": "2025-11-13T23:01:44Z",
"nvd_published_at": null,
"severity": "HIGH"
},
"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",
"id": "GHSA-3g2j-vm47-x4mj",
"modified": "2025-11-18T18:40:12Z",
"published": "2025-11-13T23:01:44Z",
"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"
}
],
"schema_version": "1.4.0",
"severity": [
{
"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",
"type": "CVSS_V4"
}
],
"summary": "LXD vulnerable to a local privilege escalation through custom storage volumes"
}
Sightings
| Author | Source | Type | Date | Other |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.