Advisory Database
  • Advisories
  • Dependency Scanning
  1. golang
  2. ›
  3. github.com/canonical/lxd
  4. ›
  5. CVE-2025-54291

CVE-2025-54291: Canonical LXD Project Existence Determination Through Error Handling in Image Get Function

October 2, 2025

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:

References

  • github.com/advisories/GHSA-xch9-h8qw-85c7
  • github.com/canonical/lxd
  • github.com/canonical/lxd/security/advisories/GHSA-xch9-h8qw-85c7
  • nvd.nist.gov/vuln/detail/CVE-2025-54291

Code Behaviors & Features

Detect and mitigate CVE-2025-54291 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions starting from 4.0 before 5.21.4, all versions starting from 6.0 before 6.5

Fixed versions

  • 5.21.4
  • 6.5

Solution

Upgrade to versions 5.21.4, 6.5 or above.

Impact 5.3 MEDIUM

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N

Learn more about CVSS

Weakness

  • CWE-209: Generation of Error Message Containing Sensitive Information

Source file

go/github.com/canonical/lxd/CVE-2025-54291.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Tue, 07 Oct 2025 00:18:42 +0000.