Under-validated ComSpec and cmd.exe resolution in Mutagen projects
Key facts
- Attack vector
- —
- Privileges required
- —
- User interaction
- —
- Attack complexity
- —
- Impact type
- —
- Confidentiality · integrity · availability
- —
- Fix status
- Fixed
No CVSS vector from any source. Fix status from GitHub.
Summary
### Impact Mutagen projects offer shell-based execution functionality. On Windows, the shell is resolved using the standard `%ComSpec%` mechanism, with a fallback to a `%PATH%`-based search for `cmd.exe`. While this is the standard practice on Windows systems, it presents somewhat risky behavior. Firstly, `%ComSpec%` could, in theory, be set maliciously. Unfortunately, there's not much that can be done to prevent this attack surface, because `%ComSpec%` is the official mechanism for shell specification on Windows. We can, however, validate that it points to an absolute path, which one would expect for a properly set value. Secondly, a fallback to a relative `cmd.exe` path, resolved via `%PATH%`, could be risky. The risk is largely mitigated by changes in Go 1.19 and later, but prior to that a malicious `cmd.exe` could been resolved in the current working directory. To mitigate this issue, Mutagen now uses the `%SystemRoot%` environment variable (also validated to be an absolute path) to resolve `cmd.exe` in the event that `%ComSpec%` is not set correctly. ### Patches The problem has been patched in Mutagen v0.16.6 and v0.17.1. Earlier versions of Mutagen are no longer supported and will not be patched. Versions of Mutagen after v0.18.0 will also have the patch merged. ### Workarounds Maintain control of the environment variable settings on your system, in particular the `ComSpec` environment variable. ### References More information on `%ComSpec%` can be found [online](https://en.wikipedia.org/wiki/COMSPEC). More information on Go's `PATH`-based lookup changes can be found [here](https://go.dev/blog/path-security), [here](https://go.dev/doc/go1.19#os-exec-path), and [here](https://github.com/golang/go/issues/43947). A [similar issue](https://github.com/python/cpython/issues/101283) that was addressed within the Python subprocess module also provides additional discussion.
Why it matters now
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| — | github.com/mutagen-io/mutagen (Go) | before 0.16.6 | 0.16.6 | Patch available | GHSA-fwj4-72fm-c93g |
| — | github.com/mutagen-io/mutagen (Go) | 0.17.0 to before 0.17.1 | 0.17.1 | Patch available | GHSA-fwj4-72fm-c93g |
- github.com/mutagen-io/mutagen (Go) Vendor— Affected before 0.16.6 Fixed in 0.16.6 Patch available GHSA-fwj4-72fm-c93g
- github.com/mutagen-io/mutagen (Go) Vendor— Affected 0.17.0 to before 0.17.1 Fixed in 0.17.1 Patch available GHSA-fwj4-72fm-c93g
Remediation
- Fix · GHSA-fwj4-72fm-c93g github.com/mutagen-io/mutagen (Go) Fixed in 0.16.6 Advisory →
- Fix · GHSA-fwj4-72fm-c93g github.com/mutagen-io/mutagen (Go) Fixed in 0.17.1 Advisory →
Timeline
- 2026-10-03 Threatist record created from GHSA-fwj4-72fm-c93g
References
Sources
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences