CVE-2025-54290: Github.com/canonical/lxd Canonical LXD Project Existence Determination Vulnerability

MODERATE
Advisory Identifier: GHSA-p3x5-mvmp-5f35
CWE-200
Published
Advisory Summary

CVE-2025-54290 is a MODERATE canonical lxd project existence determination vulnerability (CWE-200: Exposure of Sensitive Information to an Unauthorized Actor) affecting Github.com/canonical/lxd libraries in the Go ecosystem. The issue involves canonical lxd project existence determination through error handling in image export function. Remediation is available by upgrading affected packages to version 5.21.4, 6.5, 0.0.0-20250827065555-0494f5d47e41.

CVE-2025-54290 at a Glance

CVE Identifier CVE-2025-54290
GHSA Identifier GHSA-p3x5-mvmp-5f35
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-200: Exposure of Sensitive Information to an Unauthorized Actor
Affected Product Github.com/canonical/lxd
Package Ecosystem Go
Published Date
Last Updated

How to Fix CVE-2025-54290

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.

github.com/canonical/lxd fixed: 5.21.4
Upgrade github.com/canonical/lxd to 5.21.4
github.com/canonical/lxd fixed: 6.5
Upgrade github.com/canonical/lxd to 6.5
github.com/canonical/lxd fixed: 0.0.0-20250827065555-0494f5d47e41
Upgrade github.com/canonical/lxd to 0.0.0-20250827065555-0494f5d47e41
Verify Direct and Transitive Dependencies

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-54290, 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-200: Exposure of Sensitive Information to an Unauthorized Actor, where the product exposes sensitive information to an actor that is not explicitly authorized to have access to that information. 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

### Impact In LXD's images export API (`/1.0/images/{fingerprint}/export`), implementation differences in error handling allow determining project existence without authentication. Specifically, in the following code, errors when multiple images match are directly returned to users as API responses: https://github.com/canonical/lxd/blob/43d5189564d27f6161b430ed258c8b56603c2759/lxd/db/images.go#L239-L246 While fingerprints generally don't duplicate, this functionality uses fingerprints with LIKE clauses, allowing prefix specification. Therefore, using LIKE wildcards such as % will match multiple images if multiple images exist in the project. https://github.com/canonical/lxd/blob/43d5189564d27f6161b430ed258c8b56603c2759/lxd/db/images.go#L277-L286 In the above implementation, multiple matches result in a 500 error, but if the project itself doesn't exist, there are 0 matches and a 404 is returned. 1. When project exists and multiple images match: HTTP 500 error "More than one image matches" 2. When project doesn't exist: HTTP 404 error "not found" This behavioural difference allows attackers to confirm project existence without authentication. ### Reproduction Steps 1. Send a request with a pattern matching multiple entries to an existing project (default): ``` curl -k 'https://lxd-host:8443/1.0/images/%25/export?project=default&secret=x' ``` Response: ```json {"type":"error","status":"","status_code":0,"operation":"","error_code":500,"error":"More than one image matches","metadata":null} ``` 2. Send a same request to a non-existent project (not-exist): ``` curl -k 'https://lxd-host:8443/1.0/images/%25/export?project=not-exist&secret=x' ``` Response: ```json {"type":"error","status":"","status_code":0,"operation":"","error_code":404,"error":"not found","metadata":null} ``` This difference allows enumerating existing projects in the system by brute-forcing(dictionary attack) project names. Note that `%25` is the URL encoding of `%`, which works as a wildcard matching all characters in SQL LIKE clauses. This is used to intentionally create requests matching multiple images to trigger a 500 error. Additionally, the secret parameter is added to include non-public images in the search, increasing the possibility of multiple matches. https://github.com/canonical/lxd/blob/43d5189564d27f6161b430ed258c8b56603c2759/lxd/images.go#L4211-L4230 ### 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 other vulnerabilities. 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 error handling in the images export API (`/1.0/images/{fingerprint}/export`) to return consistent responses regardless of project existence. Specifically, return 404 even when errors occur during project existence verification. This ensures the same error response is returned for both existing and non-existing projects, preventing determination of project existence. Additionally, if there are no specification(compatibility) issues, allowing only exact fingerprint matches in unauthenticated states and disabling prefix matching can prevent unexpected errors from occurring. ### 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.

CVE-2025-54290 Affected Github.com/canonical/lxd Versions

3 component(s)
Fixed Versions:
5.21.46.50.0.0-20250827065555-0494f5d47e41
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-54290?
CVE-2025-54290 is a security vulnerability in Github.com/canonical/lxd involving Canonical LXD Project Existence Determination Through Error Handling in Image Export Function under CWE-200: Exposure of Sensitive Information to an Unauthorized Actor.
Which Github.com/canonical/lxd versions are affected?
Affected versions include releases prior to 5.21.4, 6.5, 0.0.0-20250827065555-0494f5d47e41 across affected packages: github.com/canonical/lxd.
What version fixes CVE-2025-54290?
Upgrading to 5.21.4, 6.5, 0.0.0-20250827065555-0494f5d47e41 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/canonical/lxd affected?
Yes, github.com/canonical/lxd is affected in releases prior to 5.21.4, 6.5, 0.0.0-20250827065555-0494f5d47e41. Upgrade your dependency to 5.21.4, 6.5, 0.0.0-20250827065555-0494f5d47e41 or later.
What CWE is associated with CVE-2025-54290?
CVE-2025-54290 is classified under CWE-200: Exposure of Sensitive Information to an Unauthorized Actor (The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information.).
How can I check Go dependencies for CVE-2025-54290?
Run the dependency tree command: 'inspect dependencies for github.com/canonical/lxd'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-p3x5-mvmp-5f35",
  "modified" : "2025-11-05T22:03:48Z",
  "published" : "2025-10-02T21:16:27Z",
  "aliases" : [ "CVE-2025-54290" ],
  "summary" : "Canonical LXD Project Existence Determination Through Error Handling in Image Export Function",
  "details" : "### Impact\nIn LXD's images export API (`/1.0/images/{fingerprint}/export`), implementation differences in error handling allow determining project existence without authentication.\n\nSpecifically, in the following code, errors when multiple images match are directly returned to users as API responses:\n\nhttps://github.com/canonical/lxd/blob/43d5189564d27f6161b430ed258c8b56603c2759/lxd/db/images.go#L239-L246\n\nWhile fingerprints generally don't duplicate, this functionality uses fingerprints with LIKE clauses, allowing prefix specification. Therefore, using LIKE wildcards such as % will match multiple images if multiple images exist in the project.\n\nhttps://github.com/canonical/lxd/blob/43d5189564d27f6161b430ed258c8b56603c2759/lxd/db/images.go#L277-L286\n\nIn the above implementation, multiple matches result in a 500 error, but if the project itself doesn't exist, there are 0 matches and a 404 is returned.\n\n1. When project exists and multiple images match: HTTP 500 error \"More than one image matches\"\n2. When project doesn't exist: HTTP 404 error \"not found\" \n \nThis behavioural difference allows attackers to confirm project existence without authentication.\n\n### Reproduction Steps\n1. Send a request with a pattern matching multiple entries to an existing project (default):\n\n```\ncurl -k 'https://lxd-host:8443/1.0/images/%25/export?project=default&secret=x'\n```\n\nResponse:\n\n```json\n{\"type\":\"error\",\"status\":\"\",\"status_code\":0,\"operation\":\"\",\"error_code\":500,\"error\":\"More than one image matches\",\"metadata\":null}\n```\n\n2. Send a same request to a non-existent project (not-exist):\n\n```\ncurl -k 'https://lxd-host:8443/1.0/images/%25/export?project=not-exist&secret=x'\n```\n\nResponse:\n\n```json\n{\"type\":\"error\",\"status\":\"\",\"status_code\":0,\"operation\":\"\",\"error_code\":404,\"error\":\"not found\",\"metadata\":null}\n```\n\nThis difference allows enumerating existing projects in the system by brute-forcing(dictionary attack) project names.\n\nNote that `%25` is the URL encoding of `%`, which works as a wildcard matching all characters in SQL LIKE clauses. \nThis is used to intentionally create requests matching multiple images to trigger a 500 error.\n\nAdditionally, the secret parameter is added to include non-public images in the search, increasing the possibility of multiple matches.\n\nhttps://github.com/canonical/lxd/blob/43d5189564d27f6161b430ed258c8b56603c2759/lxd/images.go#L4211-L4230\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. This could potentially increase the exploitability of other vulnerabilities. Additionally, since project IDs often use meaningful names set by users, this could lead to leakage of unpublished product information. \n\nHowever, resource information within projects cannot be obtained, limiting the impact to existence confirmation only.\n\n### Countermeasures\nIt is recommended to modify error handling in the images export API (`/1.0/images/{fingerprint}/export`) to return consistent responses regardless of project existence. \n\nSpecifically, return 404 even when errors occur during project existence verification.\nThis ensures the same error response is returned for both existing and non-existing projects, preventing determination of project existence.\n\nAdditionally, if there are no specification(compatibility) issues, allowing only exact fingerprint matches in unauthenticated states and disabling prefix matching can prevent unexpected errors from occurring.\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_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-p3x5-mvmp-5f35"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-54290"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/canonical/lxd"
  }, {
    "type" : "WEB",
    "url" : "https://pkg.go.dev/vuln/GO-2025-4002"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-200" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-10-02T21:16:27Z",
    "nvd_published_at" : "2025-10-02T10:15:39Z"
  }
}