Skip to main content

Security Exposure

Internet-facing SSH services are a frequent target of password guessing and spraying; MITRE ATT&CK lists SSH on 22/TCP first among commonly targeted services. Weak passwords or permitted root logins turn that into direct shell access. Server flaws matter as well: in July 2024 the OpenSSH project disclosed a race condition in sshd 8.5p1 through 9.7p1 that could allow remote code execution as root on non-OpenBSD systems.

Hardening

  • Set PasswordAuthentication to no and use public key or certificate authentication.
  • Set PermitRootLogin to no or prohibit-password, and limit logins with AllowUsers or AllowGroups.
  • Lower MaxAuthTries and use PerSourcePenalties on current OpenSSH releases to slow repeated failures.
  • Track the OpenSSH security advisories and patch sshd promptly.
  • Restrict port 22 to management networks, VPN users, or bastion hosts instead of the whole internet.

Monitoring

Collect sshd authentication logs and alert on bursts of failed logins, logins from new source addresses, and any root login. A spread of failures across many usernames from one source points to password spraying.

SSH Vulnerabilities

7 CVEs
CVECVSS
CVE-2026-123158KEV
OpenBSD OpenSSH Unexpected Status Code or Return Value Vulnerability
8.1
CVE-2026-67279KEV
SSH Pre-Authentication Rekey State Bypass in MikroTik RouterOS
6.9
CVE-2026-86060KEV
SSH session privilege manipulation via a crafted username in Mikrotik RouterOS
9.2
CVE-2025-32433KEV
Erlang/OTP SSH Vulnerable to Pre-Authentication RCE
10.0
CVE-2026-4631
Cockpit: cockpit: unauthenticated remote code execution due to ssh command-line argument injection
9.8
CVE-2026-67276
SSH user impersonation possible in Mikrotik RouterOS
9.2
CVE-2026-42508
Invoking auth bypass via unenforced @revoked status in golang.org/x/crypto/ssh/knownhosts
9.1

Frequently Asked Questions

Is SSH TCP or UDP?→

SSH runs over TCP. IANA registers port 22 for TCP, UDP, and SCTP, but RFC 4253 describes SSH over TCP/IP with servers listening on port 22.

Should port 22 be open to the internet?→

Exposure should be limited where possible, because SSH is among the services most targeted by password guessing (MITRE ATT&CK T1110.001). If it must be reachable, disable password logins and keep OpenSSH patched.

Does SFTP use port 22?→

Yes. SFTP runs inside an SSH session, so it uses the SSH port, which defaults to 22.

Which vulnerabilities affect the service on port 22?→

This database lists 7 CVEs related to SSH, 4 of them confirmed as exploited by CISA. Examples: CVE-2026-123158, CVE-2026-67279, CVE-2026-86060, CVE-2025-32433.

Port assignments from the IANA Service Name and Transport Protocol Port Number Registry. Services can be configured to run on any port, so traffic on port 22 is not guaranteed to be SSH. Exploited-in-the-wild data from the CISA KEV catalog (CC0).