{"vuln_id":"CVE-2026-40197","aliases":[],"description":"Incus is a system container and virtual machine manager. In versions before 7.0.0, missing validation logic in the storage volume import logic allows an authenticated user with access to the storage volume feature to cause the Incus daemon to crash. The custom volume backup import subsystem contains a nil-pointer dereference vulnerability during import operations. In the snapshot import loop, the daemon iterates over entries from `srcBackup.Config.VolumeSnapshots` and assumes that each slice element is initialized, then dereferences fields such as `Name`, `Config`, `Description`, `CreatedAt`, and `ExpiresAt` without first validating the element itself. Because the yaml unmarshaler accepts explicit null array elements from an attacker-controlled index.yaml and converts them into nil pointers inside the slice, an attacker can supply a backup archive containing a null entry in the volume_snapshots array. This causes a nil-pointer dereference during custom volume import and terminates the daemon, resulting in denial of service on the affected node. Repeated use of this issue can be used to keep Incus offline, causing a denial of service. This issue is fixed in version 7.0.0.","published_at":"2026-05-06T21:16:00.930000Z","modified_at":"2026-10-26T19:10:00.163000Z","first_seen_at":"2026-11-23T21:06:31.530165Z","severity":"high","severity_source":"nvd","cvss_score":7.1,"cvss_vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","cwe":["CWE-476"],"vendor":null,"product":null,"kev":{"is_kev":false,"date_added":null,"due_date":null,"ransomware":false},"epss":0.00385,"epss_percentile":0.33279,"nvd_status":"Analyzed","enriched_at":"2026-11-23T23:10:33.611483Z","links":{"nvd":"https://nvd.nist.gov/vuln/detail/CVE-2026-40197"},"matched_alias":null,"items":[{"id":16565,"source":{"id":"osv","name":"OSV.dev"},"title":"GHSA-j93m-3j9p-m5m8: LXD has CreateCustomVolumeFromBackup nil-pointer dereference on volumes[0].snapshots[*].expires_at","summary":"LXD has CreateCustomVolumeFromBackup nil-pointer dereference on volumes[0].snapshots[*].expires_at\n\n## 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,           // <-- 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` enti\n\nAffected: Go:github.com/canonical/lxd\n\nFixed in: 0.0.0-20260622081844-85f897013ccd\n\nReferences:\nhttps://github.com/canonical/lxd/security/advisories/GHSA-j93m-3j9p-m5m8\nhttps://nvd.nist.gov/vuln/detail/CVE-2026-9639\nhttps://github.com/canonical/lxd/pull/18320\nhttps://github.com/canonical/lxd/pull/18390\nhttps://github.com/canonical/lxd/commit/05bc2729e99707a766d5c4705167a3322c9ef424\nhttps://github.com/canonical/lxd/commit/c7cdfadb6044dfeaac592dc225978b4125ee23fe\nhttps://github.com/canonical/lxd/commit/d15520809e6e2ac2af0c6354dfb7be5854b0e859\nhttps://github.com/CVEProject/cvelistV5/blob/main/cves/2026/9xxx/CVE-2026-9639.json","url":"https://osv.dev/vulnerability/GHSA-j93m-3j9p-m5m8","published_at":"2026-11-06T19:37:14Z","updated_at":"2026-11-23T20:41:29.123766Z","fetched_at":"2026-11-23T21:06:31.109568Z","severity":"high","cvss_score":7.1,"epss":0.00548,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":"github.com/canonical/lxd","vuln_id":"CVE-2026-9639","vuln_ids":["CVE-2026-40197","CVE-2026-9639","GHSA-J93M-3J9P-M5M8","GHSA-R7W7-MMXR-47R9","GO-2026-6935"],"tags":["osv","go","fix-available"],"cluster_id":14721,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/16565","html":"https://vulnwatch.ve1ve2.com/item/16565"}}]}