# GHSA-57q7-rxqq-7vgp: On Windows, `git-sizer` might run a `git` executable within the repository being analyzed

- Severity: Medium (rating, scored by GitHub)
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Published: 2022-02-15T01:57:18.000Z
- Modified: 2026-03-03T04:49:54.930Z
- Also known as: GO-2022-0424

## Description

### Impact
On Windows, if `git-sizer` is run against a non-bare repository, and that repository has an executable called `git.exe`, `git.bat`, etc., then that executable might be run by `git-sizer` rather than the system `git` executable. An attacker could try to use social engineering to get a victim to run `git-sizer` against a hostile repository and thereby get the victim to run arbitrary code.

On Linux or other Unix-derived platforms, a similar problem could occur if the user's `PATH` has the current directory before the path to the standard `git` executable, but this is would be a very unusual configuration that has been known for decades to lead to all kinds of security problems.

### Patches
Users should update to git-sizer v1.4.0

### Workarounds
If you are on Windows, then either
* Don't run `git-sizer` against a repository that might contain hostile code, or, if you must…
* Run `git-sizer` against a bare clone of the hostile repository, or, if that is not possible…
* Make sure that the hostile repository doesn't have an executable in its top-level directory before running `git-sizer`.

If you are on Linux or other Unix-based system, then (for myriad reasons!) don't add the current directory to your `PATH`.

### References
* [Command PATH security in Go](https://blog.golang.org/path-security)

### For more information
If you have any questions or comments about this advisory:
* Open an issue in [the `git-sizer` project](https://github.com/github/git-sizer).
* Email us at [GitHub support](mailto:support@github.com).

(As written by GitHub Advisory Database.)

## Affected

- github.com/github/git-sizer (Go): before 1.4.0

## References

- <https://github.com/github/git-sizer/security/advisories/GHSA-57q7-rxqq-7vgp> (advisory, web)
- <https://github.com/github/git-sizer/commit/38400d6ddd79325e956b00ff584cfcc8dd96d536> (fix, web)

## Sources

- GitHub Advisory Database: [GHSA-57q7-rxqq-7vgp](https://github.com/advisories/GHSA-57q7-rxqq-7vgp), CC-BY-4.0, modified 2024-08-21
- Go Vulnerability Database: [GO-2022-0424](https://pkg.go.dev/vuln/GO-2022-0424), CC-BY-4.0, modified 2026-03-03

---

Page: https://cve.day/GHSA-57q7-rxqq-7vgp · Whole record: https://cve.day/GHSA-57q7-rxqq-7vgp.json · Rebuilt by cve.day 2026-11-25T22:56:23.101Z
