CVE-2025-54291: Canonical LXD Project Existence Determination Through Error Handling in Image Get Function
Impact The LXD /1.0/images endpoint is implemented as an AllowUntrusted API that requires no authentication, making it accessible to users without accounts. This API allows determining project existence through differences in HTTP status codes when accessed with the project parameter.
Published Oct 2, 2025 · Updated Nov 5, 2025
Affected packages
github.com/canonical/lxd
- Ecosystem
- Go
- Affected
- >= 4.0, < 5.21.4
- Fixed in
- 5.21.4
- Check
go list -m github.com/canonical/lxd
github.com/canonical/lxd
- Ecosystem
- Go
- Affected
- >= 6.0, < 6.5
- Fixed in
- 6.5
- Check
go list -m github.com/canonical/lxd
github.com/canonical/lxd
- Ecosystem
- Go
- Affected
- >= 0.0.0-20200331193331-03aab09f5b5c, < 0.0.0-20250827065555-0494f5d47e41
- Fixed in
- 0.0.0-20250827065555-0494f5d47e41
- Check
go list -m github.com/canonical/lxd
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Impact
The LXD /1.0/images endpoint is implemented as an AllowUntrusted API that requires no authentication, making it accessible to users without accounts. This API allows determining project existence through differences in HTTP status codes when accessed with the project parameter.
https://github.com/canonical/lxd/blob/43d5189564d27f6161b430ed258c8b56603c2759/lxd/images.go#L63-L69
This configuration allows access without authentication:
https://github.com/canonical/lxd/blob/43d5189564d27f6161b430ed258c8b56603c2759/lxd/daemon.go#L924-L926
This API returns a 404 error when accessing existing projects and a 403 error when accessing non-existent projects, allowing confirmation of project existence through this difference.
The problematic implementation is shown below.
First, in the error handling implementation of the imagesGet function below, project existence is checked within the projectutils.ImageProject function, and the err returned by the ImageProject function is directly returned to the user.
https://github.com/canonical/lxd/blob/43d5189564d27f6161b430ed258c8b56603c2759/lxd/i mages.go#L1781-L1788
When the project doesn't exist, the error is 404 (http.StatusNotFound), which is returned to the user:
https://github.com/canonical/lxd/blob/43d5189564d27f6161b430ed258c8b56603c2759/lxd/db/cluster/projects.mapper.go#L237-L239
On the other hand, when the project exists but the user lacks viewing permissions, the imagesGet function returns 403 (response.Forbidden):
https://github.com/canonical/lxd/blob/43d5189564d27f6161b430ed258c8b56603c2759/lxd/images.go#L1796-L1799
Reproduction Steps
- Send the following request without authentication to a non-existent project:
curl -k "https://lxd-host:8443/1.0/images?project=XXX-project"Response:
{"type":"error","status":"","status_code":0,"operation":"","error_code":404,"error":"fetch project: Project not found","metadata":null}- Send a request without authentication to an existing project (if a public project exists, it will be included in the response):
curl -k "https://lxd-host:8443/1.0/images?project=exist-project"Reponse:
{"type":"error","status":"","status_code":0,"operation":"","error_code":403,"error":"Untrusted callers may only access public images in the default project","metadata":null}Risk
The attack requires only network access to the LXD API endpoint, with no authentication needed.
The attack allows confirming the existence of projects within the LXD system by exploiting differences in HTTP status codes. This could potentially increase the exploitability of othervulnerabilities.
Additionally, since project IDs often use meaningful names set by users, this could lead to leakage of unpublished product information. However, resource information within projects cannot be obtained, limiting the impact to existence confirmation only.
Countermeasures
It is recommended to modify the error handling in the imagesGet function to return consistent responses regardless of project existence. Specifically, when an error occurs during project existence verification, the implementation should be changed to always return a 403 (Untrusted callers may only access public images in the default project) error to unauthenticated users.
This ensures that the same error response is returned for both existing and non-existing projects, preventing determination of project existence.
Patches
| LXD Series | Status | | 6 | Fixed in LXD 6.5 | | 5.21 | Fixed in LXD 5.21.4 | | 5.0 | Ignored - Not critical | | 4.0 | Ignored - EOL and not critical |
References
Reported by GMO Flatt Security Inc.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More Go vulnerabilities
All Go entriesCVE-2026-28385
LXD: SSRF via image import from URL allows internal network probing by authenticated users
medium5.0Nov 6, 2026CVE-2026-9639
LXD has CreateCustomVolumeFromBackup nil-pointer dereference on volumes[0].snapshots[*].expires_at
medium6.5Nov 6, 2026GHSA-47w9-6r3f-938g
LXD has restricted project bypass leading to arbitrary command execution
critical9.9Nov 6, 2026GHSA-7mr3-28h5-m5vx
LXD has project restriction bypass for custom volume copy across projects
high7.7Nov 6, 2026GHSA-9j25-mm2h-2f76
LXD has arbitrary file write on host via `exec-output` symlink in crafted image
critical9.9Nov 6, 2026GHSA-fmc8-p6q7-75cc
LXD has argument injection in backup compression algorithm leading to AFW and ACE
critical9.9Nov 6, 2026
