VYPR
Critical severity9.9NVD Advisory· Published Mar 27, 2026· Updated Apr 1, 2026

CVE-2026-33945

CVE-2026-33945

Description

Incus is a system container and virtual machine manager. Incus instances have an option to provide credentials to systemd in the guest. For containers, this is handled through a shared directory. Prior to version 6.23.0, an attacker can set a configuration key named something like systemd.credential.../../../../../../root/.bashrc to cause Incus to write outside of the credentials directory associated with the container. This makes use of the fact that the Incus syntax for such credentials is systemd.credential.XYZ where XYZ can itself contain more periods. While it's not possible to read any data this way, it's possible to write to arbitrary files as root, enabling both privilege escalation and denial of service attacks. Version 6.23.0 fixes the issue.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
github.com/lxc/incus/v6Go
< 6.23.06.23.0

Affected products

1

Patches

1
f74199f9983e

incusd/instance/lxc: Confine credentials write to credentials directory

https://github.com/lxc/incusStéphane GraberMar 25, 2026via ghsa
1 file changed · +10 4
  • internal/server/instance/drivers/driver_lxc.go+10 4 modified
    @@ -9520,16 +9520,22 @@ func (d *lxc) setupCredentials(update bool) error {
     		}
     	}
     
    +	credsRoot, err := os.OpenRoot(credentialsDir)
    +	if err != nil {
    +		return fmt.Errorf("Failed to open the credentials directory: %w", err)
    +	}
    +
    +	defer func() { _ = credsRoot.Close() }()
    +
     	for k, v := range credentials {
    -		credentialPath := filepath.Join(credentialsDir, k)
    -		err := os.WriteFile(credentialPath, v, 0o400)
    +		err := credsRoot.WriteFile(k, v, 0o400)
     		if err != nil {
     			return fmt.Errorf("Failed to write credential %q: %w", k, err)
     		}
     
    -		err = os.Chown(credentialPath, int(rootUID), int(rootGID))
    +		err = credsRoot.Chown(k, int(rootUID), int(rootGID))
     		if err != nil {
    -			return fmt.Errorf("Failed setting permissions for file %q: %w", credentialPath, err)
    +			return fmt.Errorf("Failed setting permissions for file %q: %w", k, err)
     		}
     
     		delete(oldCredentials, k)
    

Vulnerability mechanics

Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

4

News mentions

0

No linked articles in our index yet.