Miggo Logo

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

5.3

CVSS Score
3.1

Basic Information

EPSS Score
0.35153%
Published
10/2/2025
Updated
10/2/2025
KEV Status
No
Technology
TechnologyGo

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
Package NameEcosystemVulnerable VersionsFirst Patched Version
github.com/canonical/lxdgo>= 4.0, < 5.21.45.21.4
github.com/canonical/lxdgo>= 6.0, < 6.56.5
github.com/canonical/lxdgo>= 0.0.0-20200331193331-03aab09f5b5c, < 0.0.0-20250827065555-0494f5d47e410.0.0-20250827065555-0494f5d47e41

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability allows unauthenticated users to determine the existence of projects in LXD by observing different HTTP status codes from the /1.0/images API endpoint. A request for a non-existent project would yield a 404 error, while a request for an existing but unauthorized project would result in a 403 error. This information leak is caused by improper error handling in the imagesGet function located in lxd/images.go. The provided patch addresses this by reorganizing the logic to handle untrusted users early. Specifically, for an unauthenticated user requesting a non-default project, the patched code now consistently returns a generic 404 Not Found response, regardless of the project's actual existence. This makes it impossible to distinguish between non-existent and unauthorized projects, thus mitigating the vulnerability. The primary vulnerable function is lxd.imagesGet as it is the API handler containing the flawed logic that was patched.

Vulnerable functions

lxd.imagesGet
lxd/images.go
The `imagesGet` function, which handles the `/1.0/images` API endpoint, had a flaw in its error handling for unauthenticated requests. It would return a `404 Not Found` error for a non-existent project but a `403 Forbidden` for an existing project that the user was not authorized to see. This difference in response codes created an information disclosure vulnerability, allowing an attacker to enumerate project names. The patch rectifies this by ensuring that for unauthenticated users, a generic `404 Not Found` is returned for any non-default project, thereby making the responses consistent and closing the information leak.

WAF Protection Rules

WAF Rule

### Imp**t T** LX* /*.*/im***s *n*point is impl*m*nt** *s *n *llowUntrust** *PI t**t r*quir*s no *ut**nti**tion, m*kin* it ****ssi*l* to us*rs wit*out ***ounts. T*is *PI *llows **t*rminin* proj**t *xist*n** t*rou** *i***r*n**s in *TTP st*tus *o**s w*

Reasoning

T** vuln*r**ility *llows un*ut**nti**t** us*rs to **t*rmin* t** *xist*n** o* proj**ts in LX* *y o*s*rvin* *i***r*nt *TTP st*tus *o**s *rom t** `/*.*/im***s` *PI *n*point. * r*qu*st *or * non-*xist*nt proj**t woul* yi*l* * *** *rror, w*il* * r*qu*st *