PortGate

Advisories · Linux & SSH

CVE-2023-51385 Medium CVSS 6.5

OpenSSH ProxyCommand expansion

Disclosed 2023 · Last reviewed 2 Dec 2026

Control characters in a username or hostname could be expanded into ProxyCommand. That matters for git remotes and other untrusted SSH destinations.

What happened

Percent expansion of the user and host tokens did not reject newline and similar characters.

Affected and patched versions

Affected
OpenSSH before 9.6p1 when ProxyCommand expands a username or hostname that contains control characters.
Patched
OpenSSH 9.6p1 and later.

How to check your server

Check

sshd -V

How to fix and harden

  1. Upgrade OpenSSH to 9.6p1 or later.
  2. Do not clone or SSH to destinations you do not trust until the client is updated.
  3. A backported package below 9.6p1 can still be fixed. Confirm the changelog.

Fix

sshd -V

Sources

Version ranges and fixes follow the vendor advisory. When a distribution backports a fix, trust its security tracker over the upstream version number. New advisories: RSS · JSON