CVE-2026-41648
JSON

5.3medium

Incus: Unbounded YAML Metadata Decode via Parsing

Severity
5.3medium CVSS:4.0 by GitHub_M
Exploit likelihood
0.23% (higher than 15% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-67wx-r9xr-x75xGO-2026-5168

Description

Incus is a system container and virtual machine manager. Prior to version 7.0.0, user provided image and backup tarballs would be unpacked and YAML files parsed without any size restrictions. This was making it easy for an authenticated user to provide a crafted image or backup tarball that when parsed by Incus would lead to a very large YAML document being loaded into memory, potentially causing the entire server to run out of memory. This issue has been patched in version 7.0.0.

Affected

Product or packageVersionsReported by
lxc incus< 7.0.0CVE List
github.com/lxc/incus/v6/cmd/incusd (Go)up to 6.23.0GitHub Advisory Database
github.com/lxc/incus (Go)all versionsGo Vulnerability Database
github.com/lxc/incus/v6 (Go)all versionsGo Vulnerability Database
linuxcontainers incusbefore 7.0.0NVD

All scores

GitHub_M5.3medium CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N
GitHub5.0medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:N/I:N/A:L
GitHubmedium CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N
NVD5.0medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:N/I:N/A:L

Classification

CWE-770

SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial.

What each source says

CVE List

Incus is a system container and virtual machine manager. Prior to version 7.0.0, user provided image and backup tarballs would be unpacked and YAML files parsed without any size restrictions. This was making it easy for an authenticated user to provide a crafted image or backup tarball that when parsed by Incus would lead to a very large YAML document being loaded into memory, potentially causing the entire server to run out of memory. This issue has been patched in version 7.0.0.

GitHub Advisory Database
Summary

User provided image and backup tarballs would be unpacked and YAML files parsed without any size restrictions. This was making it easy for an authenticated user to provide a crafted image or backup tarball that when parsed by Incus would lead to a very large YAML document being loaded into memory, potentially causing the entire server to run out of memory.

Details

It was found that getImageMetadata and backup.GetInfo call yaml.NewDecoder(tr).Decode() directly on the tar reader without limiting how many bytes the YAML decoder can consume. The tar entry hdr.Size is not checked before decoding.

A tar archive can be crafted in which metadata.yaml or backup/index.yaml declares a large size in the tar header, causing the YAML decoder to read and allocate proportional memory on the server. The gopkg.in/yaml.v2 library mitigates YAML alias and anchor bombs, such as “billion laughs,” through its built-in excessive-aliasing check. However, large flat YAML documents with many keys or long string values can still produce linear but amplified memory consumption of approximately 5x to 6x the input size.

A 200 MB tar entry for metadata.yaml may cause approximately 1.2 GB of heap allocations during decode, which may be sufficient to trigger an out-of-memory condition on a constrained daemon or significantly degrade service. Because the decode occurs in the daemon process, excessive garbage-collection pressure can affect concurrent operations. Appropriate API permissions are required to upload an image or backup archive.

Mitigating factors include the fact that the amplification is linear rather than exponential, at approximately 5x to 6x, and that upload bandwidth is the practical bottleneck for delivering large payloads.

Affected Files:

Image metadata parsing reads YAML directly from the tar stream: Affected Code:

if hdr.Name == "metadata.yaml" || hdr.Name == "./metadata.yaml" {
    err = yaml.NewDecoder(tr).Decode(&result)

Backup info parsing does the same:

Affected Code:

if hdr.Name == backupIndexPath {
    err = yaml.NewDecoder(tr).Decode(&result)

if result.Config == nil && hdr.Name == "backup/container/backup.yaml" {
    err = yaml.NewDecoder(tr).Decode(&result.Config)

This was confirmed as follows:

Command:

go test ./test/fuzz -run='TestUnboundedYAMLMetadataDecode' -count=1 -v

Output:

=== RUN   TestUnboundedYAMLMetadataDecode
   image_metadata_poc_test.go:80: metadata.yaml size: 10.2 MB
   image_metadata_poc_test.go:113: metadata.yaml hdr.Size = 10688940 bytes (10.2 MB) -- no size
       check exists in getImageMetadata before yaml.NewDecoder(tr).Decode()
   image_metadata_poc_test.go:124: decoded 50000 properties from 10.2 MB metadata.yaml
   image_metadata_poc_test.go:125: yaml.NewDecoder(tr).Decode() accepted 10.2 MB metadata.yaml
       with 50000 properties -- no hdr.Size check or io.LimitReader in images.go:1457 or
       backup_info.go:88
--- FAIL: TestUnboundedYAMLMetadataDecode (0.11s)
FAIL

It is recommended to add a size check on hdr.Size before YAML decoding and to wrap the tar reader in io.LimitReader.

Proposed Fix:

const maxMetadataSize = 1 << 20 // 1 MB

if hdr.Size > maxMetadataSize {
    return nil, fmt.Errorf("metadata entry too large: %d bytes", hdr.Size)
}

err = yaml.NewDecoder(io.LimitReader(tr, maxMetadataSize)).Decode(&result)

A patch is available at https://github.com/lxc/incus/releases/tag/v7.0.0.

Credit

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

Go Vulnerability Database

Incus has Unbounded YAML Metadata Decode via Parsing in github.com/lxc/incus

NVD (es)

Incus es un gestor de contenedores de sistema y máquinas virtuales. Antes de la versión 7.0.0, los tarballs de imagen y copia de seguridad proporcionados por el usuario se desempaquetaban y los archivos YAML se analizaban sin restricciones de tamaño. Esto facilitaba a un usuario autenticado proporcionar un tarball de imagen o copia de seguridad manipulado que, al ser analizado por Incus, provocaría la carga de un documento YAML muy grande en la memoria, lo que podría causar que todo el servidor se quedara sin memoria. Este problema ha sido parcheado en la versión 7.0.0.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-41648 changed 2026-05-07CVE Terms of Use
GitHub Advisory DatabaseGHSA-67wx-r9xr-x75x changed 2026-06-25CC-BY-4.0
Go Vulnerability DatabaseGO-2026-5168 changed 2026-06-25CC-BY-4.0
NVDCVE-2026-41648 changed 2026-10-26Public domain