SSH protects the most sensitive networks. It just got a lot weaker
arstechnica.com
arstechnica.com
By the logic of a headline, a person cured of a disease is weaker afterward.
Big targets should be wary, people's Hetzner servers and VMs are probably safe. They're not worth the effort to get a MITM on.
I think the title is far less sensational than you give credit.
At this point, I don't even open any ports except whatever required for wireguard, and all services connect on that interface. For the rare times that breaks, all cloud venders have a "virtual" terminal I use.
EDIT: services includes ssh. Not sure that was clear from context.
Of course on top is the whole galaxy of gear running never-updated stacks, from UPSs and PDUs to even core stuff like network switches which I've seen linger on completely obsolete cipher choices for ages. Or web GUIs doing the same with HTTPS (if they even support HTTPS(!)). Some stuff arguably should just be airgapped entirely, but if/when that's not possible stuff it behind a lot of layers of protection would be nice. I'd love to see an in-line form factor PoE ultra minimal dongle whose only job in life is to run Wireguard or Nebula or Tailscale or something, translating from that to an ethernet port that any ancient device can talk into and insuring 100% of traffic will go via that or not at all at the hardware level. Then could effectively mediate all traffic even to ancient stuff via that without it ever needing to even hit a switch.
I believe this is the future as envisioned by tailscale. Where some kind of key-exchange server is used alongside DNS, and DNS itself uses something like wireguard encryption.
This is a type of "network slug"[1][2] and it is a very good idea.
An immutable, two-port (in and out) hardware "slug" that enforces your network policy no matter what form of misconfiguration lies behind it is a tool I hope more people will avail themselves of.
Would you still call that a "network slug"? Might be a decent name regardless, but the description there sounds much, much simpler and more focused on layer 2.
Since their actions were done in public, researchers went back, and found that their main contribution to the spec was blocking anything that would simplify the implementation, and fast tracking as much needless complexity as possible.
From what I can tell, Wire Guard is based on that story, since it doesn't include any session-time negotiation of ciphers, etc.
tl;dr: Runtime negotiation of encryption algorithms considered harmful.
Wireguard exchanges keys prior using well trusted implementations, and common "wireguard-implemented-tools" facilitate key generation and exchange on top of that. This is sane, and only vulnerable to supply-chain attacks in libsodium, or key leaks at either:
a) compromised host (so that host can decrypt incoming traffic) or
b) the key-exchange mechanism, for which open source implementations exist e.g., Nebula / Tailscale.
Regardless ...
Given that it is in addition to ssh (it's ssh over wireguard, not ssh or wireguard), I find any arguments against a wide class of encryption standards to be not very compelling.
With ssh + wireguard you need state-level hacks on libsodium and ssh vulnerabilities to have a general-purpose attack like you see with the Snowden stuff
However, this is important context.
I'm curious if Tinyssh is immune to this attack, since it doesn't implement sha1 (especially as I'm using it in several places).
"State-of-the-art crypto: ssh-ed25519, curve25519-sha256, chacha20-poly1305@openssh.com"
> I am an admin, should I drop everything and fix this?
> Probably not.
> The attack requires an active Man-in-the-Middle attacker that can intercept...
#!/bin/bash
# Function to apply Terrapin Mitigation to SSH configurations
terrapin_mitigation() {
echo "Applying Terrapin mitigation to SSH client and daemon config..."
# Function to filter algorithms, reading from stdin
filter_algorithms() {
while read -r alg; do
if [[ "$alg" != *"chacha20-poly1305@openssh.com"* ]] && [[ "$alg" != *"-cbc"* ]] && [[ "$alg" != *"-etm@openssh.com"* ]]; then
echo "$alg"
else
echo "Removing vulnerable $alg" >&2
fi
done
}
# Ensure .d directories exist
sudo mkdir -p /etc/ssh/sshd_config.d
sudo mkdir -p /etc/ssh/ssh_config.d
# Get and filter algorithms
kex_algorithms=$(ssh -Q kex | filter_algorithms)
ciphers=$(ssh -Q cipher | filter_algorithms)
macs=$(ssh -Q mac | filter_algorithms)
# Create configuration lines
kex_line="KexAlgorithms $(echo "$kex_algorithms" | tr '\n' ',')"
cipher_line="Ciphers $(echo "$ciphers" | tr '\n' ',')"
mac_line="MACs $(echo "$macs" | tr '\n' ',')"
# Remove trailing commas
kex_line=${kex_line%,}
cipher_line=${cipher_line%,}
mac_line=${mac_line%,}
# Output to sshd.d and ssh.d files
echo ""
echo "*** /etc/ssh/sshd_config.d/terrapin-mitigation: ***"
{ echo "$kex_line"; echo "$cipher_line"; echo "$mac_line"; } | sudo tee /etc/ssh/sshd_config.d/terrapin-mitigation
echo ""
echo "*** /etc/ssh/ssh_config.d/terrapin-mitigation: ***"
{ echo "$kex_line"; echo "$cipher_line"; echo "$mac_line"; } | sudo tee /etc/ssh/ssh_config.d/terrapin-mitigation
echo ""
echo "Terrapin mitigation configuration updated!"
}
terrapin_mitigation
Because of the way SSH resolves its config (first of CLI, user local, system wide), in some cases you may prefer to alias ssh to configure this at the command line.Also disabling some algorithms might bar you from connections that are limited to those. I'm not an expert, this is just what I threw together now. You're welcome to use it unless you know a better way. Please suggest improvements if you see them and use at your own discretion otherwise! :)
# Ensure .d directories exist
sudo mkdir -p /etc/ssh/sshd_config.d
sudo mkdir -p /etc/ssh/ssh_config.d
Note that this was added in OpenSSH 8.2, released 2020-02-14:* https://bugzilla.mindrot.org/show_bug.cgi?id=2468
* https://www.openssh.com/txt/release-8.2
If you have an older version this will not work.
Hoo boy.
Maybe? If you include "use a third-party hoster" into the idea of "have a huge security problem".
From a different comment (https://news.ycombinator.com/item?id=38710214) , two months ago an organization found their Hetzner server was MITMed https://news.ycombinator.com/item?id=37955264 . The source article says "We believe this is lawful interception Hetzner and Linode were forced to setup."
tl;dr: People's assumptions about SSH enabling a secure tunnel are not necessarily valid.
first need MITM, and that's not trivial. next need to be running to asyncssh (which has a straight-up bug in its state machine). next need to be running specific ciphers which use the ssh packet sequence number in their IV.
it is a moderate big deal because it's a protocol flaw, not just a bug. so the openssh "patch" actually introduces a new protocol option, which doesn't help unless both sides select it.
> ChaCha20-Poly1305 [30] directly uses the sequence number in its key derivation, which makes it vulnerable to our prefix truncation attack...
> Note that the fault is not with ChaCha20-Poly1305 as an AEAD encryption scheme, but with its integration into the SSH secure channel construction.