Skip to content

Project restriction bypass via cross-project instance copy

Critical
stgraber published GHSA-mq9x-prm8-3vpw Jul 30, 2026

Package

gomod github.com/lxc/incus/v7/cmd/incusd (Go)

Affected versions

< v7.3.0

Patched versions

>= v7.3.0

Description

Summary

When copying an instance across projects, the project restriction check (AllowInstanceCreation) runs BEFORE the source instance's configuration is merged into the request. Dangerous configuration keys (including security.privileged, raw.lxc, raw.apparmor) from the source instance are merged AFTER the check passes, bypassing all project restrictions on the target project.

Details

The vulnerability exists in cmd/incusd/instances_post.go:

  1. Line 1440: project.AllowInstanceCreation(tx, targetProjectName, req) checks restrictions against req — at this point, req.Config is empty or contains only user-supplied overrides (typically none for a plain copy)
  2. Line 1528: createFromCopy() is called AFTER the check passes
  3. Lines 680-691 (inside createFromCopy): Source instance config is iterated and ALL non-volatile keys are merged into req.Config via InstanceIncludeWhenCopying()
  4. internal/instance/config.go:1826: InstanceIncludeWhenCopying returns true for dangerous keys including security.privileged (config.go:956), raw.lxc (config.go:836), and raw.apparmor (config.go:293)

Notably, the backup restore path at lines 1013-1036 HAS a late restriction check after the instance is fully assembled — the copy path has no equivalent post-merge validation. This asymmetry strongly suggests an oversight.

Attack Chain

  1. Attacker has access to two projects: one unrestricted (or views instances in one), one restricted
  2. Source project has instance with security.privileged=true and/or raw.lxc hooks
  3. Attacker sends:
    POST /1.0/instances?project=restricted-project
    {"name": "evil", "source": {"type": "copy", "source": "priv-container", "project": "unrestricted-project"}}
    
  4. AllowInstanceCreation passes (req.Config is empty at check time)
  5. createFromCopy merges source config including security.privileged=true
  6. Instance created in restricted project with unrestricted configuration
  7. Attacker starts instance → privileged container → host escape

Impact

Full container escape from a restricted project. An attacker who can view an instance in an unrestricted project and create instances in a restricted project can bypass all project-level security restrictions.

Preconditions

  • Attacker has CanView on a source instance in an unrestricted (or less-restricted) project
  • Attacker has CanCreateInstances in a restricted target project
  • Source instance has dangerous configuration (security.privileged, raw.lxc, etc.)

Suggested Fix

Add a late restriction check in createFromCopy() AFTER the source config merge (after line 692), similar to the existing check in the backup restore path at lines 1013-1036. Validate the FINAL merged config against the target project's restrictions.

Credit

Vulnerability independently discovered and responsibly disclosed by Zhixi "Jace" Sun (@manus-use).

Severity

Critical

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
Low
User interaction
None
Scope
Changed
Confidentiality
High
Integrity
High
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H

CVE ID

CVE-2026-62941

Weaknesses

Incorrect Authorization

The product performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check. Learn more on MITRE.

Credits