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.
| Package | Affected versions | Patched versions |
|---|---|---|
github.com/lxc/incus/v6Go | < 6.23.0 | 6.23.0 |
Affected products
1Patches
1f74199f9983eincusd/instance/lxc: Confine credentials write to credentials directory
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- github.com/advisories/GHSA-q4q8-7f2j-9h9fghsaADVISORY
- github.com/lxc/incus/security/advisories/GHSA-q4q8-7f2j-9h9fnvdVendor AdvisoryWEB
- nvd.nist.gov/vuln/detail/CVE-2026-33945ghsaADVISORY
- github.com/lxc/incus/commit/f74199f9983e2ce78f2b78b6d765c6635b229c82ghsaWEB
News mentions
0No linked articles in our index yet.