# GHSA-x5c7-x7m2-rhmf: Local directory executable lookup in sops (Windows-only)

- Severity: Low (rating, scored by GitHub)
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Published: 2021-05-20T16:50:34.000Z
- Modified: 2026-03-03T04:52:10.110Z
- Also known as: GO-2022-0410

## Description

### Impact
Windows users using the sops direct editor option (`sops file.yaml`) can have a local executable named either `vi`, `vim`, or `nano` executed if running sops from `cmd.exe`

This attack is only viable if an attacker is able to place a malicious binary within the directory you are running sops from. As well, this attack will only work when using `cmd.exe` or the Windows C library [SearchPath function](https://docs.microsoft.com/en-us/windows/win32/api/processenv/nf-processenv-searchpatha). This is a result of these Windows tools including `.` within their `PATH` by default.

**If you are using sops within untrusted directories on Windows via `cmd.exe`, please upgrade immediately** 

**As well, if you have `.` within your default $PATH, please upgrade immediately.**

More information can be found on the official Go blog: https://blog.golang.org/path-security

### Patches
The problem has been resolved in v3.7.1

Now, if Windows users using cmd.exe run into this issue, a warning message will be printed:
`vim resolves to executable in current directory (.\vim.exe)`

### References
* https://blog.golang.org/path-security

### For more information
If you have any questions or comments about this advisory:
* Open a discussion in [sops](https://github.com/mozilla/sops/discussions)

(As written by GitHub Advisory Database.)

## Affected

- go.mozilla.org/sops/v3 (Go): before 3.7.1
- go.mozilla.org/sops (Go): all versions

## References

- <https://github.com/mozilla/sops/security/advisories/GHSA-x5c7-x7m2-rhmf> (advisory, web)

## Sources

- GitHub Advisory Database: [GHSA-x5c7-x7m2-rhmf](https://github.com/advisories/GHSA-x5c7-x7m2-rhmf), CC-BY-4.0, modified 2024-08-21
- Go Vulnerability Database: [GO-2022-0410](https://pkg.go.dev/vuln/GO-2022-0410), CC-BY-4.0, modified 2026-03-03

---

Page: https://cve.day/GHSA-x5c7-x7m2-rhmf · Whole record: https://cve.day/GHSA-x5c7-x7m2-rhmf.json · Rebuilt by cve.day 2026-11-25T22:56:23.092Z
