# CVE-2022-41953: Git clone remote code execution vulnerability in git-for-windows

> Git for Windows GUI executes a bundled aspell.exe from the current directory, allowing remote code execution via malicious repositories.

- **Severity:** High 8.6 (`CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Local or same network only
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 17 Jan 2023
- **Updated:** 10 Mar 2025
- **Also known as:** AZL-13025, GHSA-v4px-mx59-w99c, OESA-2023-1059

## What is CVE-2022-41953?

CVE-2022-41953 is a high-severity command injection vulnerability in git-for-windows git, published on 17 Jan 2023. 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

Git GUI is a convenient graphical tool that comes with Git for Windows. Its target audience is users who are uncomfortable with using Git on the command-line. Git GUI has a function to clone repositories. Immediately after the local clone is available, Git GUI will automatically post-process it, among other things running a spell checker called `aspell.exe` if it was found. Git GUI is implemented as a Tcl/Tk script. Due to the unfortunate design of Tcl on Windows, the search path when looking for an executable _always includes the current directory_. Therefore, malicious repositories can ship with an `aspell.exe` in their top-level directory which is executed by Git GUI without giving the user a chance to inspect it first, i.e. running untrusted code. This issue has been addressed in version 2.39.1. Users are advised to upgrade. Users unable to upgrade should avoid using Git GUI for cloning. If that is not a viable option, at least avoid cloning from untrusted sources.

Weakness: CWE-426 (Untrusted Search Path)

## Which versions are affected by CVE-2022-41953?

It affects 1 product.


Products: Git-Scm Git.

## How do I fix CVE-2022-41953?

Upgrade to a fixed version.

## Is CVE-2022-41953 being exploited?

There is no known exploitation of CVE-2022-41953 in the wild and no public exploit code.

## Other vulnerabilities in git-for-windows git

- [CVE-2022-23521](https://insights.sbomify.com/CVE-2022-23521/): gitattributes parsing integer overflow in git (critical 9.8)
- [CVE-2022-41903](https://insights.sbomify.com/CVE-2022-41903/): Integer overflow in `git archive`, `git log --format` leading to RCE in git (critical 9.8)
- [CVE-2019-1353](https://insights.sbomify.com/CVE-2019-1353/): Security feature bypass in Git (critical 9.8)
- [CVE-2016-2315](https://insights.sbomify.com/CVE-2016-2315/): Memory corruption in n/a (critical 9.8)
- [CVE-2016-2324](https://insights.sbomify.com/CVE-2016-2324/): Integer overflow in n/a (critical 9.8)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2022-41953 and fix it if it is affected.

What it is: CVE-2022-41953 is a high-severity command injection vulnerability in git-for-windows git, published on 17 Jan 2023. 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 CVE-2022-41953 in the wild and no public exploit code.

Affected product: git-for-windows git. No package-level version data is available, so check the vendor advisory linked from the reference page.

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/CVE-2022-41953/ (Markdown: https://insights.sbomify.com/CVE-2022-41953/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2022-41953
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2022-41953
- OSV: https://osv.dev/vulnerability/CVE-2022-41953

---
From sbomify Insights: https://insights.sbomify.com/CVE-2022-41953/
Summaries are generated and may contain mistakes; the official description above is the record.
