{"answers":{"affected":"5 open source packages ship an affected version, including github.com/mutagen-io/mutagen.","exploited":"There is no known exploitation of GHSA-fwj4-72fm-c93g in the wild and no public exploit code.","fix":"Upgrade github.com/mutagen-io/mutagen to a fixed version for your release line: 0.16.6 or 0.17.1.","what":"GHSA-fwj4-72fm-c93g is a command injection vulnerability in github.com/mutagen-io/mutagen, published on 5 May 2023. It can only be exploited from the same machine or local network, with no action from the victim."},"fix_prompt":"Check this codebase for GHSA-fwj4-72fm-c93g and fix it if it is affected.\n\nWhat it is: GHSA-fwj4-72fm-c93g is a command injection vulnerability in github.com/mutagen-io/mutagen, published on 5 May 2023. It can only be exploited from the same machine or local network, with no action from the victim.\nExploitation: There is no known exploitation of GHSA-fwj4-72fm-c93g in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- github.com/mutagen-io/mutagen (Go): affected all versions; fixed in 0.16.6, 0.17.1\n- github.com/mutagen-io/mutagen (Go): affected all versions; fixed in 0.16.6\n- github.com/mutagen-io/mutagen (Go): affected all versions; fixed in 0.16.6\n- github.com/mutagen-io/mutagen (Go): affected from 0.17.0; fixed in 0.17.1\n- github.com/mutagen-io/mutagen (Go): affected from 0.17.0; fixed in 0.17.1\n\nTask:\n1. 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.\n2. 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.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/GHSA-fwj4-72fm-c93g/ (Markdown: https://insights.sbomify.com/GHSA-fwj4-72fm-c93g/index.md)","id":"GHSA-fwj4-72fm-c93g","markdown":"https://insights.sbomify.com/GHSA-fwj4-72fm-c93g/index.md","name":"GHSA-fwj4-72fm-c93g","record":{"aliases":["GO-2023-1758"],"analysis":{"component_type":"developer_tool","fix_type":"upgrade","impacts":["code_execution"],"network_reachable":"adjacent_or_local","non_default_config":false,"product_category":"Mutagen file sync tool","requires_auth":"none","summary":"Attackers can execute arbitrary commands on Windows by manipulating ComSpec or PATH environment variables to hijack shell resolution in Mutagen.","user_interaction":"not_required","vuln_class":"command_injection"},"analysis_generated_by":"qwen3.8-flash-next","assigner":null,"cpe":[],"cvss":{"score":null,"severity":null,"source":null,"vector":null,"version":null},"cwes":[],"description":"### Impact\n\nMutagen 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.\n\nFirstly, `%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.\n\nSecondly, 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.\n\n### Patches\n\nThe 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.\n\n### Workarounds\n\nMaintain control of the environment variable settings on your system, in particular the `ComSpec` environment variable.\n\n### References\n\nMore information on `%ComSpec%` can be found [online](https://en.wikipedia.org/wiki/COMSPEC).\n\nMore 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).\n\nA [similar issue](https://github.com/python/cpython/issues/101283) that was addressed within the Python subprocess module also provides additional discussion.","ecosystems":["Go"],"exploits":{"exploitdb":null,"first_seen":null,"github_poc":null,"max_poc_stars":null,"metasploit":null,"nuclei":null,"refs":[],"tier":null},"has_fix":true,"headline":"Under-validated ComSpec and cmd.exe resolution in Mutagen projects","id":"GHSA-fwj4-72fm-c93g","indexable":true,"kev":null,"kind":"advisory","links":{"ecosystem":"Go","product":null,"products":[],"type":"command_injection","year":"2023"},"n_packages":5,"n_references":null,"packages":[{"ecosystem":"Go","fixed":["0.16.6","0.17.1"],"introduced":["0","0.17.0"],"last_affected":[],"package":"github.com/mutagen-io/mutagen","purl":"pkg:golang/github.com/mutagen-io/mutagen","source":"GO-2023-1758"},{"ecosystem":"Go","fixed":["0.16.6"],"introduced":["0"],"last_affected":[],"package":"github.com/mutagen-io/mutagen","purl":null,"source":"GHSA-fwj4-72fm-c93g"},{"ecosystem":"Go","fixed":["0.16.6"],"introduced":["0"],"last_affected":[],"package":"github.com/mutagen-io/mutagen","purl":"pkg:golang/github.com/mutagen-io/mutagen","source":"GHSA-fwj4-72fm-c93g"},{"ecosystem":"Go","fixed":["0.17.1"],"introduced":["0.17.0"],"last_affected":[],"package":"github.com/mutagen-io/mutagen","purl":null,"source":"GHSA-fwj4-72fm-c93g"},{"ecosystem":"Go","fixed":["0.17.1"],"introduced":["0.17.0"],"last_affected":[],"package":"github.com/mutagen-io/mutagen","purl":"pkg:golang/github.com/mutagen-io/mutagen","source":"GHSA-fwj4-72fm-c93g"}],"products":null,"published":"2023-05-05","related":[],"sources":[{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"CC BY 4.0","name":"Go Vulnerability Database","prefix":"GO"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":null,"updated":null,"vendors":null},"summary":"Attackers can execute arbitrary commands on Windows by manipulating ComSpec or PATH environment variables to hijack shell resolution in Mutagen.","url":"https://insights.sbomify.com/GHSA-fwj4-72fm-c93g/"}