GHSA-3g2j-vm47-x4mj — lxd
Fix: canonical/lxd#16904GHSA-3g2j-vm47-x4mj is a security vulnerability in github.com/canonical/lxd. A fix is available for github.com/canonical/lxd — see the affected versions and patch details below.
LXD vulnerable to a local privilege escalation through custom storage volumes
Real-World Exposure
github.com/canonical/lxdReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects Go packages — download data is not available via public APIs for these ecosystems.
Description
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:
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐹Go | github.com/canonical/lxd | all versions | 0.0.0-20251110144034-698854d0164fgo get github.com/canonical/lxd@v0.0.0-20251110144034-698854d0164f |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for github.com/canonical/lxd, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update github.com/canonical/lxd to 0.0.0-20251110144034-698854d0164f or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-3g2j-vm47-x4mj is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
How O3 protects you
O3 Security's impact-aware SCA analyses which vulnerable code paths your application actually calls, so a match like GHSA-3g2j-vm47-x4mj can be triaged on real exposure rather than presence alone.
Tailored to GHSA-3g2j-vm47-x4mj. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.
Frequently Asked Questions
Is GHSA-3g2j-vm47-x4mj in your dependencies?
O3 Security finds GHSA-3g2j-vm47-x4mj across Go dependencies, including transitive ones, and its impact-aware SCA ranks findings by whether your code actually calls the vulnerable path.