Security Digest · Critical advisory (no CVE assigned)

GHSA-9j25-mm2h-2f76: LXD has arbitrary file write on host via `exec-output` symlink in crafted image

Reported from https://github.com/lxc/incus/security/advisories/GHSA-48q5-w887-33wv Summary The record-output parameter of the /instances/$name/exec endpoint stores the output of the command in the exec-output directory of the instance.

CVSS 9.9 Critical GitHub-reviewed · critical

Should you act?

  • Only if you depend on one of the packages below, directly or transitively, in a vulnerable version. Check your lockfile with govulncheck ./....
  • No CVE has been assigned, so it will not appear in CVE-based scanners that ignore GitHub advisories. npm audit, pip-audit and Dependabot do read GitHub advisories.

Affected packages

EcosystemPackageVulnerableFirst fixed
Gogithub.com/canonical/lxd< 0.0.0-20260626085134-124f901006400.0.0-20260626085134-124f90100640

Details

Reported from https://github.com/lxc/incus/security/advisories/GHSA-48q5-w887-33wv

Summary

The record-output parameter of the /instances/$name/exec endpoint stores the output of the command in the exec-output directory of the instance. If exec-output is a symlink, file named execUUID.stdout and execUUID.stderr can be written to an arbitrary location where the .stdout file will contain arbitrary content. This behavior can be abused for arbitrary command execution.

Details

When an image is unpacked, top-level symlinks are extracted as is; allowing for exec-output to be placed on disk. In instanceexec.go, os.Mkdir continues of exec-output exists and os.OpenFile follows the exec-output symlink.

PoC

Below, we place the execUUID.stdout file in /etc/cron.d on the host for arbitrary command execution.

Impact

CVSS: 9.9 (v3.1) CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H

Sources and references

  1. GitHub Advisory GHSA-9j25-mm2h-2f76 github.com
  2. github.com github.com
  3. github.com github.com
  4. nvd.nist.gov nvd.nist.gov
  5. github.com github.com
  6. github.com github.com
  7. github.com github.com
  8. github.com github.com
  9. github.com github.com
  10. github.com github.com
  11. manpages.debian.org manpages.debian.org

Critical Go advisories · Today’s Security Digest