GHSA-x6jc-phwx-hp32 CVE-2026-23953 GO-2026-4359
Incus container environment configuration newline injection
- Severity
- 8.7 / 10
- High · CVSS 3.1
- Exploit chance (EPSS)
- 0.49%
- Chance of exploitation in the next 30 days. Higher than 42.18% of scored vulnerabilities.
- Known exploited
- No
- Not in CISA's catalog
- Weakness
- CWE-93 Improper Neutralization of CRLF Sequences ('CRLF Injection')
- Fix
6.21.0- Upgrade github.com/lxc/incus/v6 to this version or later
Description
Summary
A user with the ability to launch a container with a custom YAML configuration (e.g a member of the ‘incus’ group) can create an environment variable containing newlines, which can be used to add additional configuration items in the container’s lxc.conf due to the newline injection. This can allow adding arbitrary lifecycle hooks, ultimately resulting in arbitrary command execution on the host.
Details
When passing environment variables in the config block of a new container, values are not checked for the presence of newlines [1], which can result in newline injection inside the generated container lxc.conf. This can be used to set arbitrary additional configuration items, such as lxc.hook.pre-start. By exploiting this, a user with the ability to launch a container with an arbitrary config can achieve arbitrary command execution as root on the host.
Exploiting this issue on IncusOS requires a slight modification of the payload to change to a different writable directory for the validation step (e.g /tmp). This can be confirmed with a second container with /tmp mounted from the host (A privileged action for validation only).
[1] https://github.com/lxc/incus/blob/HEAD/internal/server/instance/drivers/driver_lxc.go#L1081
PoC
A proof-of-concept script exploiting this vulnerability can be found attached, named environment_newline_injection.sh, showing arbitrary command execution, which will write a file to the root filesystem (/newline_injection_command_exec_poc)
Manual Reproduction steps:
- Launch a new container with a configuration file containing a multiline YAML string as an environment variable value, such as in the listing below.
- Observe that the lxc.conf (
/run/incus/user-1000_poc/lxc.confin my case) contains an additionallxc.hook.pre-startitem - Observe the creation of the file in the host root directory, with contents proving command execution as root.
incus launch images:alpine/edge --ephemeral poc << EOF
config:
environment.FOO: |-
abc
lxc.hook.pre-start = /bin/sh -c "id > /newline_injection_command_exec_poc"
EOF
Impact
A user with the ability to launch a container with a custom YAML configuration (e.g a member of the ‘incus’ group) can achieve arbitrary command execution on the host.
Attachments
environment_newline_injection.sh environment_newline_injection.patch
Affected versions
Go
| Package | Vulnerable | Fixed in |
|---|---|---|
| github.com/lxc/incus | all versions |
No fix yet |
| github.com/lxc/incus/v6 | < 6.21.0 |
6.21.0 |
| github.com/lxc/incus/v6 | >= 6.1.0 |
No fix yet |
How to fix
Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.
github.com/lxc/incus/v6 Go → 6.21.0
- go
go get github.com/lxc/incus/v6@v6.21.0 && go mod tidy
Severity breakdown
CVSS 3.1 8.7
CVSS:3.1/AV:A/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:N
- Attack vector
- Adjacent
- Attack complexity
- Low
- Privileges required
- Low
- User interaction
- None
- Scope
- Changed
- Confidentiality
- High
- Integrity
- High
- Availability
- None
Weakness
CWE-93: Improper Neutralization of CRLF Sequences ('CRLF Injection')
The product uses CRLF (carriage return line feeds) as a special element, e.g. to separate lines or records, but it does not neutralize or incorrectly neutralizes CRLF sequences from inputs.
How to prevent it
- Implementation: Avoid using CRLF as a special sequence.
- Implementation: Appropriately filter or quote CRLF sequences in user-controlled input.
References
Advisories
Packages
Other links
Timeline
- Published
- Last updated by the source
- Latest EPSS score
Related advisories
| Advisory | Severity | Why it's related |
|---|---|---|
| GO-2026-6319 Incus has a project restriction bypass in instance copy across projects | High | Also affects github.com/lxc/incus |
| GHSA-64f3-v33m-w89f Incus has a project restriction bypass for custom volume copy across projects | High | Also affects github.com/lxc/incus |
| GO-2026-5806 Incus has an arbitrary file write on its client due to trusted image hash | Critical | Also affects github.com/lxc/incus |
| GO-2026-5810 Incus: CreateCustomVolumeFromBackup nil-pointer dereference on volume_snapshots[*].expires_at (sibling-field variant of GHSA-r7w7) | Low | Also affects github.com/lxc/incus |
| GO-2026-5808 Incus has an argument injection in backup compression algorithm leading to AFW and ACE | Critical | Also affects github.com/lxc/incus |
| GO-2026-5800 Incus: Nil-pointer dereference in createDependentVolumesFromBackup on disk.{Volume,VolumeSnapshots,Pool} | Low | Also affects github.com/lxc/incus |
| GO-2026-5802 Incus has an arbitrary file write via path traversal in S3 multipart upload | Critical | Also affects github.com/lxc/incus |
| GO-2026-5803 Incus has arbitrary file read+write on host via templates/ symlink in malicious image | Critical | Also affects github.com/lxc/incus |
MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.
Check your repos with MergeHarbor