GHSA-mggc-4xg6-vcxf

Suggest an improvement
Source
https://github.com/advisories/GHSA-mggc-4xg6-vcxf
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/09/GHSA-mggc-4xg6-vcxf/GHSA-mggc-4xg6-vcxf.json
JSON Data
https://api.test.osv.dev/v1/vulns/GHSA-mggc-4xg6-vcxf
Aliases
Published
2026-09-17T17:18:01Z
Modified
2026-09-17T17:30:05Z
Severity
  • 7.5 (High) CVSS_V3 - CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H CVSS Calculator
Summary
SSH.NET: ScpClient allows server-side RCE via default SCP path handling
Details

Summary

Default SCP remote-path handling places caller-supplied paths into the command that runs scp on the server. On a shell-based server that command is interpreted by a shell, so an attacker-influenced path that is not quoted to suit that shell can execute as a command as the authenticated SSH user. SSH.NET provides ScpClient.RemotePathTransformation to control escaping behaviour (defaulting to RemotePathTransformation.DoubleQuote) but cannot guarantee safety for arbitrary remote command interpreters. This is inherent to running scp over a remote shell (cf. CVE-2020-15778).

Impact

Command execution on the SSH server as the authenticated SSH user, when an application passes an attacker-influenced remote path to ScpClient against a shell-based server.

Exploitation depends on conditions beyond the attacker's control: the remote server must be shell-based, and the attacker-influenced path must be crafted to defeat the quoting applied by the transformation in effect — that is, to use metacharacters that it does not neutralise (for example $(...) or backticks, which survive the default double-quoting on a POSIX shell). A path that does not meet these escaping rules, or a non-shell-based server, does not result in command execution.

Remediation

The fixed release obsoletes the constructors that silently defaulted the path transformation and adds constructors that require an explicit IRemotePathTransformation, so callers are required to choose one that suits their server and trust environment. For POSIX shells, the library provides RemotePathTransformation.ShellQuote. The legacy default (RemotePathTransformation.DoubleQuote) is unchanged for backwards compatibility. SCP is considered legacy and SFTP, which does not involve a remote shell, is recommended where possible (via SftpClient).

Database specific
{
    "cwe_ids":  [
        "CWE-78"
    ],
    "github_reviewed":  true,
    "github_reviewed_at":  "2026-09-17T17:18:01Z",
    "nvd_published_at":  "2026-09-16T17:18:16Z",
    "severity":  "HIGH"
}
References

Affected packages

NuGet / SSH.NET

Package

Name
SSH.NET
View open source insights on deps.dev
Purl
pkg:nuget/SSH.NET

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0 Unknown introduced version / All previous versions are affected
Fixed
2026.0.0

Affected versions

2011.*
2011.7.29
2011.9.28
2011.12.7
2012.*
2012.3.9
2012.12.3
2012.20.12
2012.21.12
2013.*
2013.1.8
2013.1.27
2013.4.7
2014.*
2014.4.6-beta1
2014.4.6-beta2
2016.*
2016.0.0-beta1
2016.0.0-beta2
2016.0.0-beta3
2016.0.0
2016.1.0-beta1
2016.1.0-beta2
2016.1.0-beta3
2016.1.0-beta4
2016.1.0
2020.*
2020.0.0-beta1
2020.0.0
2020.0.1
2020.0.2
2023.*
2023.0.0
2023.0.1
2024.*
2024.0.0
2024.1.0
2024.2.0
2025.*
2025.0.0
2025.1.0

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/09/GHSA-mggc-4xg6-vcxf/GHSA-mggc-4xg6-vcxf.json"