There have been a variety of issues with different SSH daemon implementations and configurations. You can also just make a dangerous mistake with your own configuration, or a cloud provider can easily have a bad default cloud-init sshd config that overrides your safe config, etc.
One good example:
regreSSHion, CVE-2024-6387, is an unauthenticated remote code execution in OpenSSH’s server (sshd) that grants full root access. It affects the default configuration and does not require user interaction. It poses a significant exploit risk.https://www.qualys.com/regresshion-cve-2024-6387
With WireGuard, using a pre-shared key, attackers are interacting with virtually no code unless they have a valid encrypted packet, and then they still need the peer key to connnect.
With an SSH server, there's a lot of code being executed by any remote attacker pre-authentication. Any exploit in this code can grant access. This is just inherently more risky.
I'm weakly inclined to view wireguard as even safer than openssh, but that's not the same as saying that the latter is proven unsafe. As that link notes, that was "the first OpenSSH vulnerability in nearly two decades", and while it was bad, it doesn't appear that anyone demonstrated exploitation against a 64-bit host, and openssh's response ( https://lists.mindrot.org/pipermail/openssh-unix-announce/20... ) was to promptly separate components precisely to reduce the amount of code that an unauthenticated attacker can even possibly reach. Wireguard has less code and is deliberately harder to hold wrong, but what code it has is running in ring zero, which a person could also describe as "just inherently more risky".
Again, not wanting to act like wireguard is bad or openssh is perfect. I just think your comment is a bit far the other way.
> As that link notes, that was "the first OpenSSH vulnerability in nearly two decades"...
The quote is "OpenSSH vulnerability in nearly two decades—an unauthenticated RCE that grants full root access" which is qualified because there have been other significant OpenSSH security vulnerabilities over the years.
You're also ignoring the sshd misconfiguration issue which is a serious problem. OpenSSH supports password authentication among other potential footguns.
> Wireguard has less code and is deliberately harder to hold wrong, but what code it has is running in ring zero, which a person could also describe as "just inherently more risky".
That "regreSSHion" exploit above was a remote root exploit. There's no practical difference between root access and a "ring zero" kernel exploit in most cases.
WireGuard is over a decade old at this point, so the record speaks for itself.
There's definitely more room for user error with SSH. At one point I thought I was hardening my /etc/ssh/sshd_config by adding things to the end to override the defaults. Turns out that config file is "first rule wins", so my changes had no effect.
One good example:
regreSSHion, CVE-2024-6387, is an unauthenticated remote code execution in OpenSSH’s server (sshd) that grants full root access. It affects the default configuration and does not require user interaction. It poses a significant exploit risk. https://www.qualys.com/regresshion-cve-2024-6387
With WireGuard, using a pre-shared key, attackers are interacting with virtually no code unless they have a valid encrypted packet, and then they still need the peer key to connnect.
With an SSH server, there's a lot of code being executed by any remote attacker pre-authentication. Any exploit in this code can grant access. This is just inherently more risky.