Alta

SSH.NET: ScpClient allows server-side RCE via default SCP path handling

  • Publicada: 17.09.2026
  • Actualizado: 11.10.2026 11:23

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).

Software afectado

Haz clic en una tecnología para ver todas sus vulnerabilidades.

PlataformaPaqueteVersiones vulnerablesCorregida en
.NET (NuGet) SSH.NET < 2026.0.0 2026.0.0

Referencias

Puntuación CVSS 7.5/10
Vector CVSS
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
Debilidad (CWE)
CWE-78
Plataforma
.NET (NuGet)
Paquete
SSH.NET
Publicada
17.09.2026
Actualizado
11.10.2026 11:23

Fuentes y licencias

OSV / GitHub Advisory Database - GHSA-mggc-4xg6-vcxf - CC BY 4.0

Historial de vulnerabilidades: SSH.NET

Todas las vulnerabilidades publicadas de este paquete (.NET (NuGet)), de la más reciente a la más antigua. Muestra si es un fallo aislado o un paquete que hay que vigilar.

Entradas en total
3
Primera → última
06.2022 09.2026
Sin corrección
0
Explotada en ataques
0

Distribución por gravedad

  • Alta 2
  • Media 1

Divulgaciones por año

  1. 2022: 1
  2. 2023: 0
  3. 2024: 0
  4. 2025: 0
  5. 2026: 2
  1. SSH.NET: ScpClient allows server-side RCE via default SCP path handling esta entrada
    Alta · 7.5 CVE-2026-85756 < 2026.0.0 2026.0.0
  2. Media · 6.5 CVE-2022-29245 < 2020.0.2 2020.0.2

Identifica las vulnerabilidades de tu aplicación

Con la integración de DockRay y el inventario de software activado, DockRay compara las versiones notificadas de los componentes con las vulnerabilidades conocidas y avisa de las coincidencias confirmadas. La cobertura depende de la tecnología compatible y de los avisos disponibles.

Conectar tu aplicación
Newsletter DockRay

La seguridad de tus aplicaciones en tu correo

Vulnerabilidades importantes, recomendaciones concretas y consejos prácticos para tus aplicaciones. Elige tus tecnologías y sigue lo que importa para tu proyecto.

  • Un resumen diario de nuevas vulnerabilidades, también las críticas.
  • Avisos sobre actualizaciones importantes.
  • Consejos prácticos sobre seguridad y monitorización de aplicaciones.

Déjalo vacío para recibir avisos de todas las tecnologías.

Suscripción gratuita. Date de baja con un clic en cualquier correo.