GHSA-98p4-xjmm-8mfh — gix-transport
MEDIUMGHSA-98p4-xjmm-8mfh is a medium-severity (CVSS 6.4) CWE-77 vulnerability in gix-transport. A fix is available for gix-transport — see the affected versions and patch details below.
gix-transport indirect code execution via malicious username
Exploitation Status
Proof-of-concept exploit code exists
- CISA’s SSVC triage found public proof-of-concept exploit code for this CVE, though no confirmed active exploitation.
- A successful exploit gives an attacker total control of the affected component, not partial access.
Exploitation and automatability from CISA’s SSVC triage for GHSA-98p4-xjmm-8mfh.
EPSS Exploitation Probability
EPSS (Exploit Prediction Scoring System) is a daily probability model maintained by FIRST.org. It estimates the likelihood a CVE will be exploited in production environments within the next 30 days, derived from real-world threat intelligence signals.
How urgent is this, really
GHSA-98p4-xjmm-8mfh plotted by exploitation likelihood (EPSS) against impact (CVSS). The shaded corner — EPSS 50%+ and CVSS 7.0+ — is where this CVE doesn't sit, though severity or exploitability alone can still warrant action.
Where this sits among everything scored
Of 377,166 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Real counts from FIRST.org, not a sample — log-scaled since the landscape is heavily right-skewed.
Real-World Exposure
gix-transport🦀gix🦀gitoxideReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects crates.io packages — download data is not available via public APIs for these ecosystems.
Description
Summary
gix-transport does not check the username part of a URL for text that the external ssh program would interpret as an option. A specially crafted clone URL can smuggle options to SSH. The possibilities are syntactically limited, but if a malicious clone URL is used by an application whose current working directory contains a malicious file, arbitrary code execution occurs.
Details
This is related to the patched vulnerability https://github.com/advisories/GHSA-rrjw-j4m2-mf34, but appears less severe due to a greater attack complexity. Since https://github.com/Byron/gitoxide/pull/1032, gix-transport checks the host and path portions of a URL for text that has a - in a position that will cause ssh to interpret part of all of the URL as an option argument. But it does not check the non-mandatory username portion of the URL.
As in Git, when an address is a URL of the form ssh://username@hostname/path, or when it takes the special form username@hostname:dirs/repo, this is treated as an SSH URL. gix-transport will replace some characters in username with their %-based URL encodings, but otherwise passes username@hostname as an argument to the external ssh command. This happens even if username begins with a hyphen. In that case, ssh treats that argument as an option argument, and attempts to interpret and honor it as a sequence of one or more options possibly followed by an operand for the last option.
This is harder to exploit than GHSA-rrjw-j4m2-mf34, because the possibilities are constrained by:
-
The difficulty of forming an option argument
sshaccepts, given that characters such as=,/, and\, are URL-encoded,:is removed, and the argument passed tosshcontains the@sign and subsequent host identifier, which in an effective attack must be parseable as a suffix of the operand passed to the last option.The inability to include a literal
=prevents the use of-oNAME=VALUE(e.g.,-oProxyCommand=payload). The inability to include a literal/or\prevents smuggling in a path operand residing outside the current working directory, incuding on Windows. (Although a~character may be smuggled in,sshdoes not perform its own tilde expansion, so it does not form an absolute path.) -
The difficulty, or perhaps impossibility, of completing a connection (other than when arbitrary code execution has been achieved). This complicates or altogether prevents the use of options such as
-Aand-Xtogether with a connection to a real but malicious server. The reason a connection cannot generally be completed when exploiting this vulnerability is that, because the argumentgix-transportintends as a URL is treated as an option argument,sshtreats the subsequent non-option argumentgit-upload-packas the host instead of the command, but it is not a valid host name.Although
sshsupports aliases for hosts, even ifgit-upload-packcould be made an alias, that is made difficult by the URL-encoding transformation.
However, an attacker who is able to cause a specially named ssh configuration file to be placed in the current working directory can smuggle in an -F option referencing the file, and this allows arbitrary command execution.
This scenario is especially plausible because programs that operate on git repositories are often run in untrusted git repositories, sometimes even to operate on another repository. Situations where this is likely, such that an attacker could predict or arrange it, may for some applications include a malicious repository with a malicious submodule configuration.
Other avenues of exploitation exist, but appear to be less severe. For example, the -E option can be smuggled to create or append to a file in the current directory (or its target, if it is a symlink). There may also be other significant ways to exploit this that have not yet been discovered, or that would arise with new options in future versions of ssh.
PoC
To reproduce the known case that facilitates arbitrary code execution, first create a file in the current directory named [email protected], of the form
ProxyCommand payload
where payload is a command with an observable side effect. On Unix-like systems, this could be date | tee vulnerable or an xdg-open, open, or other command command to launch a graphical application. On Windows, this could be the name of a graphical application already in the search path, such as calc.exe.
(Although the syntax permitted in the value of ProxyCommand may vary by platform, this is not limited to running commands in the current directory. That limitation only applies to paths directly smuggled in the username, not to the contents of a separate malicious configuration file. Arbitrary other settings may be specified in [email protected] as well.)
Then run:
gix clone 'ssh://[email protected]/abc'
Or:
gix clone -- '[email protected]:abc/def'
(The -- is required to ensure that gix is really passing the argument as a URL for use in gix-transport, rather than interpreting it as an option itself, which would not necessarily be a vulnerability.)
In either case, the payload specified in [email protected] runs, and its side effect can be observed.
Other cases may likewise be produced, in either of the above two forms of SSH addresses. For example, to create or append to the file [email protected], or to create or append to its target if it is a symlink:
gix clone 'ssh://[email protected]/abc'
gix clone -- '[email protected]:abc/def'
Impact
As in https://github.com/advisories/GHSA-rrjw-j4m2-mf34, this would typically require user interaction to trigger an attempt to clone or otherwise connect using the malicious URL. Furthermore, known means of exploiting this vulnerability to execute arbitrary commands require further preparatory steps to establish a specially named file in the current directory. The impact is therefore expected to be lesser, though it is difficult to predict it with certainty because it is not known exactly what scenarios will arise when using the gix-transport library.
Users who use applications that make use of gix-transport are potentially vulnerable, especially:
- On repositories with submodules that are automatically added, depending how the application manages submodules.
- When operating on other repositories from inside an untrusted repository.
- When reviewing contributions from untrusted developers by checking out a branch from an untrusted fork and performing clones from that location.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🦀crates.io | gix-transport | all versions | 0.42.0cargo update -p gix-transport --precise 0.42.0 |
| 🦀crates.io | gix | all versions | 0.62cargo update -p gix --precise 0.62 |
| 🦀crates.io | gitoxide | all versions | 0.35cargo update -p gitoxide --precise 0.35 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for gix-transport, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update gix-transport to 0.42.0 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-98p4-xjmm-8mfh is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
How O3 protects you
O3 Security's impact-aware SCA analyses which vulnerable code paths your application actually calls, so a match like GHSA-98p4-xjmm-8mfh can be triaged on real exposure rather than presence alone.
Tailored to GHSA-98p4-xjmm-8mfh. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.
Frequently Asked Questions
Is GHSA-98p4-xjmm-8mfh in your dependencies?
O3 Security finds GHSA-98p4-xjmm-8mfh across crates.io dependencies, including transitive ones, and its impact-aware SCA ranks findings by whether your code actually calls the vulnerable path.