GHSA-fmc8-p6q7-75cc: Argument Injection in Canonical LXD Backup Compression Leads to Host Root Code Execution
Vulnerability ID: GHSA-FMC8-P6Q7-75CC
CVSS Score: 9.9
Published: 2026-11-06
GHSA-fmc8-p6q7-75cc (associated with CVE-2026-48755) is a critical argument injection vulnerability in Canonical LXD (github.com/canonical/lxd). The vulnerability occurs during instance and storage volume backup operations when processing the user-supplied compression_algorithm configuration parameter. While LXD validates the primary executable token against an allowlist of supported compression binaries, it fails to sanitize or restrict subsequent tokens parsed via shellquote.Split. These additional arguments are passed directly to exec.Command. An authenticated attacker with privileges to trigger backups can inject command-line flags for utilities like zstd to read staged files from a container filesystem and write them to arbitrary paths on the underlying host filesystem, such as /etc/cron.d/, achieving root-level arbitrary code execution on the host.
TL;DR
An argument injection flaw in Canonical LXD's backup compression handling allows authenticated users to pass arbitrary command-line flags to host compression utilities like zstd. By abusing flags such as -o, an attacker can write files from a container directly to the host's /etc/cron.d/ directory, escaping the container and executing arbitrary code as root on the host.
⚠️ Exploit Status: POC
Technical Details
- Vulnerability ID: GHSA-fmc8-p6q7-75cc (CVE-2026-48755)
- Primary Weakness: CWE-88: Argument Injection
- CVSS v3.1 Score: 9.9 Critical (AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H)
- Affected Component: Canonical LXD (compressFile / backup compression parser)
- Attack Vector: Authenticated REST API request (/1.0/instances/{name}/backups)
- Security Impact: Container escape, arbitrary host file write, root RCE
- Exploit Maturity: Public Proof-of-Concept (PoC)
- CISA KEV Status: Not Listed
Affected Systems
- Canonical LXD (github.com/canonical/lxd)
- Linux Containers Incus (github.com/lxc/incus)
- github.com/canonical/lxd: < 0.0.0-20260630083100-c5184be310b1 (Fixed in:
0.0.0-20260630083100-c5184be310b1)
Code Analysis
Commit: 0915bb8
AppArmor confinement wrapper for backup file compression (CVE-2026-48755)
Commit: 0ab30d1
Pass sys.OS state and apply AppArmor wrapper during compression
Commit: 1887e3d
Update callers of compressFile to supply sys.OS
Commit: 32fd885
AppArmor archive profile generation for compression binaries
Commit: 932592d
Backport compression AppArmor confinement to stable branch
Commit: 9b09906
Confine compression utilities using AppArmor CompressWrapper
Commit: a280842
Ensure backup compression commands run under AppArmor profile
Commit: afc0e7f
Update backup export paths to pass sysOS into compressFile
Commit: b3e8ced
Add AppArmor CompressWrapper implementation in lxd/apparmor/archive.go
Commit: c6c9995
Apply AppArmor confinement to image and backup compression
Commit: e1e6018
Backport CVE-2026-48755 compression wrapper fixes
Commit: e224d6f
lxd/images: Confine compressFile execution with AppArmor
Exploit Details
- GitHub Advisory (Incus Upstream PoC): Publicly documented Python proof-of-concept script demonstrating remote RCE via zstd argument injection into /etc/cron.d/.
- GitHub Advisory (Canonical LXD): Canonical LXD security advisory containing full reproduction steps and PoC script.
Mitigation Strategies
- Upgrade Canonical LXD to a patched release containing the AppArmor CompressWrapper confinement.
- Ensure the Linux kernel has AppArmor enabled and enforcing so that dynamic confinement profiles are applied to compressor subprocesses.
- Restrict access to the LXD UNIX socket and REST API (:8443) exclusively to trusted host administrators.
- Deploy auditd rules and file integrity monitoring on /etc/cron.d/, /etc/crontab, and /etc/ld.so.preload to detect unauthorized host file writes.
Remediation Steps:
- Refresh the LXD Snap package to the latest patched revision: sudo snap refresh lxd
- For source or Go module deployments, update github.com/canonical/lxd to at least 0.0.0-20260630083100-c5184be310b1.
- Verify that AppArmor is active on the host by running: sudo aa-status
- Audit existing client certificates and tokens via 'lxc config trust list' and remove untrusted clients.
References
- Canonical LXD Security Advisory: GHSA-fmc8-p6q7-75cc
- Linux Containers Incus Security Advisory: GHSA-v6mj-8pf4-hhw4
- NVD Detail: CVE-2026-48755
- Canonical LXD Fix Commit: e224d6f8230a2da7ed7e60ab2aee44c788f9dba8
- Canonical LXD Fix Commit: 0915bb88cbb0baed5ac1aef8e62079c57ac877da
Read the full report for GHSA-FMC8-P6Q7-75CC on our website for more details including interactive diagrams and full exploit analysis.