Skip to main content

CVE-2022-25328: CWE-78 OS Command Injection in Google LLC fscrypt

Medium
Published: Fri Feb 25 2022 (02/25/2022, 11:00:15 UTC)
Source: CVE
Vendor/Project: Google LLC
Product: fscrypt

Description

The bash_completion script for fscrypt allows injection of commands via crafted mountpoint paths, allowing privilege escalation under a specific set of circumstances. A local user who has control over mountpoint paths could potentially escalate their privileges if they create a malicious mountpoint path and if the system administrator happens to be using the fscrypt bash completion script to complete mountpoint paths. We recommend upgrading to version 0.3.3 or above

AI-Powered Analysis

AILast updated: 06/20/2025, 13:06:33 UTC

Technical Analysis

CVE-2022-25328 is a security vulnerability classified as an OS Command Injection (CWE-78) affecting the bash_completion script used by the fscrypt tool developed by Google LLC. Fscrypt is a utility designed to provide encryption support for filesystems on Linux. The vulnerability arises because the bash_completion script improperly handles mountpoint paths when performing command completion. Specifically, if a local user can create or control mountpoint paths containing crafted malicious input, these inputs can be injected into the bash_completion script's command execution context. This leads to the possibility of executing arbitrary commands with the privileges of the user running the shell, which in many cases could be a system administrator or root user. The attack scenario requires that the attacker has local access and the ability to create or manipulate mountpoint paths. The system administrator or privileged user must then use the fscrypt bash completion feature to complete mountpoint paths in a shell session. Under these conditions, the injected commands execute, potentially allowing privilege escalation. The vulnerability does not appear to have been exploited in the wild as of the published date. The vendor recommends upgrading to fscrypt version 0.3.3 or later, where this issue has been addressed. No specific affected versions were detailed, but the vulnerability is tied to the bash_completion script component of fscrypt prior to the fix. This vulnerability highlights the risks of command injection in shell completion scripts, especially when they process untrusted input such as filesystem mountpoints that can be influenced by local users.

Potential Impact

For European organizations, this vulnerability poses a moderate risk primarily in environments where fscrypt is deployed to manage filesystem encryption and where multiple users have local access to systems, such as shared servers or developer workstations. The ability for a local user to escalate privileges by injecting commands through mountpoint paths could lead to unauthorized access to sensitive encrypted data, modification or deletion of critical files, and potential disruption of services. Organizations relying on fscrypt for protecting data confidentiality could see a compromise in data integrity and confidentiality if this vulnerability is exploited. While remote exploitation is not feasible, insider threats or attackers who have gained limited local access could leverage this flaw to gain higher privileges, increasing the risk of lateral movement and persistence within networks. The impact is heightened in environments where system administrators frequently use bash completion for fscrypt mountpoints, as this is the trigger for exploitation. Given the medium severity and the requirement for local access and user interaction, the overall risk is moderate but should not be underestimated in sensitive or high-security environments.

Mitigation Recommendations

1. Upgrade fscrypt to version 0.3.3 or later immediately to ensure the bash_completion script is patched against this command injection vulnerability. 2. Restrict local user permissions to prevent unauthorized creation or manipulation of mountpoint paths, especially on systems where fscrypt is used. 3. Limit the use of bash completion scripts for fscrypt mountpoints by privileged users or disable the fscrypt bash_completion script if not necessary. 4. Implement strict monitoring and auditing of mountpoint creation and modification activities to detect suspicious or unauthorized changes. 5. Educate system administrators and users about the risks of using shell completion features with untrusted inputs and encourage cautious behavior when completing mountpoints. 6. Employ mandatory access controls (e.g., SELinux, AppArmor) to restrict the execution context of bash completion scripts and limit the potential impact of command injection. 7. Regularly review and update local user access policies to minimize the number of users with the ability to influence mountpoint paths. These steps go beyond generic advice by focusing on controlling the attack vector (mountpoint path manipulation), limiting the attack surface (bash completion usage), and enhancing detection and response capabilities.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Google
Date Reserved
2022-02-18T00:00:00.000Z
Cisa Enriched
true

Threat ID: 682d984bc4522896dcbf7fc4

Added to database: 5/21/2025, 9:09:31 AM

Last enriched: 6/20/2025, 1:06:33 PM

Last updated: 8/14/2025, 8:54:27 AM

Views: 14

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats