---
title: "GHSA-pjff-c2wc-f6jm: LXD has arbitrary file write on client due to trusted image hash"
url: https://erroneo.us/security/ghsa/GHSA-pjff-c2wc-f6jm/
description: "GHSA-pjff-c2wc-f6jm (critical, Go): LXD has arbitrary file write on client due to trusted image hash. Reported from…"
type: advisory
section: "Security Digest"
date_published: 2026-11-06
date_modified: 2026-11-06
publisher: erroneo.us
author: erroneo.us Security Desk
ghsa: "GHSA-pjff-c2wc-f6jm"
license: All rights reserved. Quote with attribution and a link.
---

# GHSA-pjff-c2wc-f6jm: LXD has arbitrary file write on client due to trusted image hash

## Affected packages

- Go `github.com/canonical/lxd` < 0.0.0-20260630083100-c5184be310b1 → fixed: 0.0.0-20260630083100-c5184be310b1

## Details

Reported from https://github.com/lxc/incus/security/advisories/GHSA-f6m5-xw2g-xc4x Summary An arbitrary file write exists in the Incus client when a malicious image server returns a crafted Incus-Image-Hash header. This can lead to arbitrary command execution as root on the server. Details - cmd/incusd/images.go:611-684 handles source.type=url by HEADing the user-supplied URL, reading Incus-Image-Hash and Incus-Image-URL, and passing them to imageDownload() as Alias and Server. - cmd/incusd/daemonimages.go:91-92 defaults fp to the caller-controlled alias string. - cmd/incusd/daemonimages.go:333-335 builds destName := filepath.Join(destDir, fp). - cmd/incusd/daemonimages.go:469-523 enters the direct protocol branch, opens destName with os.Create(), and copies the HTTP response into that file. - cmd/incusd/daemonimages.go:528-532 validates the SHA-256 only after the file has already been created and populated. - cmd/incusd/daemonimages.go:337-344 cleanup only runs after the copy returns; a slow or held response extends the arbitrary-write window. A malicious image server returning something along the following will cause the arbitrary file write. PoC The script below creates a malicious image server and requests an Incus server to fetch the image. File write occurs when the image is unpacked. The following script was generated by an LLM. Impact An arbitrary file write on the client with root privileges; possibly leading to arbitrary command execution.

## Sources

- [GitHub Advisory GHSA-pjff-c2wc-f6jm](https://github.com/advisories/GHSA-pjff-c2wc-f6jm)
- [github.com](https://github.com/canonical/lxd/security/advisories/GHSA-pjff-c2wc-f6jm)
- [github.com](https://github.com/lxc/incus/security/advisories/GHSA-f6m5-xw2g-xc4x)
- [nvd.nist.gov](https://nvd.nist.gov/vuln/detail/CVE-2026-48769)

---
Source page: https://erroneo.us/security/ghsa/GHSA-pjff-c2wc-f6jm/ · Security Digest: https://erroneo.us/security/ · More: https://erroneo.us/llms.txt
