Summary
VeraCrypt on Linux has a command injection flaw in CoreUnix::CheckFilesystem, where an unsanitized virtual-device value is incorporated into a shell command. A local attacker with same-UID access and an active elevated CoreService session may be able to execute commands with root privileges.
Affected context
The issue affects VeraCrypt on Linux when CoreUnix::CheckFilesystem processes a virtual-device value during an active elevated CoreService session. Risk depends on a local attacker with the same UID being able to access the service's request pipe and influence that value.
Exploit preconditions
- Attack surface: Local Linux IPC through the elevated CoreService request pipe
- Required access: Same-UID access and the ability to access or reopen the relevant pipe
- Trigger point: Processing of the
VirtualDevicevalue byCoreUnix::CheckFilesystem - Why exploitation is possible: The value is incorporated into a shell command without adequate sanitization, allowing shell interpretation in the elevated service context
Why this happens
The underlying bug is the construction of a shell command using externally influenceable input without safely separating data from command syntax. This is OS command injection, mapped to CWE-78: Improper Neutralization of Special Elements used in an OS Command. The risk arises when a value intended to identify a device is interpreted by a shell as part of the command.
Potential impact
- An attacker may execute arbitrary commands with the elevated service's privileges, potentially as root.
- The host's data or configuration could be modified or exposed.
- The compromised system could be used to affect other local services or users.
General mitigation guidance
Defensive approaches focus on avoiding shell interpretation of values that can be influenced by callers.
- Prefer direct process execution with separate, fixed arguments rather than composing shell command strings.
- Validate device identifiers against a narrow, explicit allowlist and reject unexpected values.
- Apply context-appropriate escaping only where shell use cannot be avoided.
- Limit the privileges and accessible resources of elevated services, and restrict access to their IPC endpoints.
- Treat values received through local pipes as untrusted, even when they originate from the same user account.
How teams detect issues like this
- Use static analysis rules to flag shell command construction involving externally influenced values.
- Review code paths that pass device names or IPC-provided data to shells or process-launch APIs.
- Check that input validation occurs before command construction and that accepted values follow a narrow policy.
- Enforce secure coding policies that prohibit shell execution for operations that can use direct APIs.
- Use automated code review tools as an additional way to identify risky command-building patterns.

