# GHSA-w4f8-fxq2-j35v: Possible privilege escalation via bash completion script

> Local attackers can escalate privileges by crafting malicious mountpoint paths that trigger command injection in the fscrypt bash completion script.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Local or same network only
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 1 Mar 2022

## What is GHSA-w4f8-fxq2-j35v?

GHSA-w4f8-fxq2-j35v is a command injection vulnerability in github.com/google/fscrypt, published on 1 Mar 2022. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.

### Official description

The bash completion script for `fscrypt` through v0.3.2 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 v0.3.3 or above.

For more details, see [CVE-2022-25328](https://www.cve.org/CVERecord?id=CVE-2022-25328).

## Which versions are affected by GHSA-w4f8-fxq2-j35v?

2 open source packages ship an affected version, including github.com/google/fscrypt.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/google/fscrypt` | Go | All versions | 0.3.3 |
| `github.com/google/fscrypt` | Go | All versions | 0.3.3 |

## How do I fix GHSA-w4f8-fxq2-j35v?

Upgrade github.com/google/fscrypt to 0.3.3 or later.

## Is GHSA-w4f8-fxq2-j35v being exploited?

There is no known exploitation of GHSA-w4f8-fxq2-j35v in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-w4f8-fxq2-j35v and fix it if it is affected.

What it is: GHSA-w4f8-fxq2-j35v is a command injection vulnerability in github.com/google/fscrypt, published on 1 Mar 2022. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of GHSA-w4f8-fxq2-j35v in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/google/fscrypt (Go): affected all versions; fixed in 0.3.3
- github.com/google/fscrypt (Go): affected all versions; fixed in 0.3.3

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/GHSA-w4f8-fxq2-j35v/ (Markdown: https://insights.sbomify.com/GHSA-w4f8-fxq2-j35v/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-w4f8-fxq2-j35v

---
From sbomify Insights: https://insights.sbomify.com/GHSA-w4f8-fxq2-j35v/
Summaries are generated and may contain mistakes; the official description above is the record.
