CVE-2025-54291: Github.com/canonical/lxd Canonical LXD Project Existence Determination Vulnerability
MODERATECVE-2025-54291 is a MODERATE (CVSS 5.3) canonical lxd project existence determination vulnerability (CWE-209: Generation of Error Message Containing Sensitive Information) affecting Github.com/canonical/lxd libraries in the Go ecosystem. The issue involves canonical lxd project existence determination through error handling in image get function. Remediation is available by upgrading affected packages to version 5.21.4, 6.5, 0.0.0-20250827065555-0494f5d47e41.
CVE-2025-54291 at a Glance
Security Impact
CVSS: 5.3
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N).
How to Fix CVE-2025-54291
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.
Upgrade github.com/canonical/lxd to 5.21.4
Upgrade github.com/canonical/lxd to 6.5
Upgrade github.com/canonical/lxd to 0.0.0-20250827065555-0494f5d47e41
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 CVE-2025-54291, 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 5.21.4), 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-209: Generation of Error Message Containing Sensitive Information, where the product generates an error message that includes sensitive information about its environment, users, or associated data. 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
CVE-2025-54291 Affected Github.com/canonical/lxd Versions
3 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/canonical/lxd
|
Go |
≥ 4.0
< 5.21.4
|
5.21.4
|
|
github.com/canonical/lxd
|
Go |
≥ 6.0
< 6.5
|
6.5
|
|
github.com/canonical/lxd
|
Go |
≥ 0.0.0-20200331193331-03aab09f5b5c
< 0.0.0-20250827065555-0494f5d47e41
|
0.0.0-20250827065555-0494f5d47e41
|
References
Frequently Asked Questions
What is CVE-2025-54291?
Which Github.com/canonical/lxd versions are affected?
What version fixes CVE-2025-54291?
Is github.com/canonical/lxd affected?
What is the CVSS score of CVE-2025-54291?
What CWE is associated with CVE-2025-54291?
How can I check Go dependencies for CVE-2025-54291?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-xch9-h8qw-85c7",
"modified" : "2025-11-05T22:07:56Z",
"published" : "2025-10-02T21:15:46Z",
"aliases" : [ "CVE-2025-54291" ],
"summary" : "Canonical LXD Project Existence Determination Through Error Handling in Image Get Function",
"details" : "### Impact\nThe 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.\n\n\nhttps://github.com/canonical/lxd/blob/43d5189564d27f6161b430ed258c8b56603c2759/lxd/images.go#L63-L69\n\nThis configuration allows access without authentication:\n\nhttps://github.com/canonical/lxd/blob/43d5189564d27f6161b430ed258c8b56603c2759/lxd/daemon.go#L924-L926\n\nThis 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.\n\nThe problematic implementation is shown below.\n\nFirst, 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.\n\n\nhttps://github.com/canonical/lxd/blob/43d5189564d27f6161b430ed258c8b56603c2759/lxd/i mages.go#L1781-L1788\n\nWhen the project doesn't exist, the error is 404 (http.StatusNotFound), which is\nreturned to the user:\n\nhttps://github.com/canonical/lxd/blob/43d5189564d27f6161b430ed258c8b56603c2759/lxd/db/cluster/projects.mapper.go#L237-L239\n\nOn the other hand, when the project exists but the user lacks viewing permissions, the imagesGet function returns 403 (response.Forbidden):\n\nhttps://github.com/canonical/lxd/blob/43d5189564d27f6161b430ed258c8b56603c2759/lxd/images.go#L1796-L1799\n\n### Reproduction Steps\n1. Send the following request without authentication to a non-existent project:\n\n```\ncurl -k \"https://lxd-host:8443/1.0/images?project=XXX-project\"\n```\n\nResponse:\n\n```json\n{\"type\":\"error\",\"status\":\"\",\"status_code\":0,\"operation\":\"\",\"error_code\":404,\"error\":\"fetch project: Project not found\",\"metadata\":null}\n```\n\n2. Send a request without authentication to an existing project (if a public project exists, it will be included in the response):\n\n```\ncurl -k \"https://lxd-host:8443/1.0/images?project=exist-project\"\n```\n\nReponse:\n\n```\n{\"type\":\"error\",\"status\":\"\",\"status_code\":0,\"operation\":\"\",\"error_code\":403,\"error\":\"Untrusted callers may only access public images in the default project\",\"metadata\":null}\n```\n\n### Risk\nThe attack requires only network access to the LXD API endpoint, with no authentication needed.\n\nThe attack allows confirming the existence of projects within the LXD system by exploiting differences in HTTP status codes. \nThis could potentially increase the exploitability of othervulnerabilities.\n\nAdditionally, 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.\n\n### Countermeasures\nIt 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.\n\nThis ensures that the same error response is returned for both existing and non-existing\nprojects, preventing determination of project existence.\n\n### Patches\n\n| LXD Series | Status |\n| ------------- | ------------- |\n| 6 | Fixed in LXD 6.5 |\n| 5.21 | Fixed in LXD 5.21.4 |\n| 5.0 | Ignored - Not critical |\n| 4.0 | Ignored - EOL and not critical |\n\n### References\nReported by GMO Flatt Security Inc.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/canonical/lxd"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "4.0"
}, {
"fixed" : "5.21.4"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/canonical/lxd"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "6.0"
}, {
"fixed" : "6.5"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/canonical/lxd"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0.0.0-20200331193331-03aab09f5b5c"
}, {
"fixed" : "0.0.0-20250827065555-0494f5d47e41"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/canonical/lxd/security/advisories/GHSA-xch9-h8qw-85c7"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-54291"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/canonical/lxd"
}, {
"type" : "WEB",
"url" : "https://pkg.go.dev/vuln/GO-2025-4005"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-209" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2025-10-02T21:15:46Z",
"nvd_published_at" : "2025-10-02T10:15:39Z"
}
}