Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Whereas a public open SSH port has always seemed (and proved) dangerous, now more than ever.

Wait, did I miss something? When has opensshd proven dangerous to expose?

 help



It's impossible to detect an open wireguard port as no response is generated unless you have the correct key. SSH on the other hand is easily scanned for.

> unless you have the correct key

To be clear, this is not about the pre-shared key. What you need is a hash of the server's public key for the initial handshake. The PSK is only used after that.


> easily scanned for.

unless you use IP whitelisting


By definition that would not be a public, open port.

i don’t think so. i whitelist my vpn IP for ssh into a few machines and when i forget to turn my VPN on and try to access it, i get “permission denied (public key)”. whereas if i close port 22 entirely i get “network not reachable”.

You’re both right. If sshd is enforcing the whitelist you should see what you see. If instead you’ve got some kind of firewall mediating the traffic, then you should be invisible to anyone outside the whitelist.

Or TCPMD5, which I have tried to sell to openssh, even sending patches, as I recall.

With the major drawback that TCPMD5 doesn't work through NAT.


TCPMD5 is a really terrible hack. Authentication is better done at either the application layer, or the VPN layer.

Which is great if you're always behind a particular IP. As for the rest of the world...

I've had success allow listing the whole IPv6 ASN block my ISP owns. It cuts down on all the drive by attempts and if someone on my ISP's network was trying to break in they'll still need to defeat SSH before I notice the stream of failed login attempts and report them.

I have the naive hope that as a paying customer of my ISP they'll take my abuse report involving a fellow customer seriously.


Don't forget to add the IP blocks of your new provider, if you ever decide to switch...

Tailscale bridges that gap nicely for what it’s worth.

Yup. Since figuring out how to get it to advertise a route to my home private up range (from my home server which is always connected) I just leave Tailscale on most of the time I’m not at home and I’m always able to connect to anything at home. I don’t even have to make that my exit node, which is great because my DOCSIS uplink speed is crap.

This is an argument for security-through-obscurity.

The phrase "security thru obscurity" is something that people parrot because they heard it somewhere and it makes them feel smart. In reality, all cybersecurity is security thru obscurity. There's nothing else but obscurity. The entire field of encryption is literally obscuring.

A thinking person understands that security, like obscurity, is just a matter of degree, and the only lever you have is increasing the cost for the attacker by increasing obscurity. Security isn't binary, it's a matter of degree in the form of cost.


Obscure as in "I'm using a port nobody can guess" and obscure as in "I multiplied two large primes together that nobody can guess" are very different. Crypto is definitely obscuring, but it is muddying the waters too much to conflate them.

Technically that’s only because the port is 2 bits of secrecy. If port numbers were 128 bits we’d be having a different conversation I think.

Just to nipick, that's 2 bytes, so 16 bits of secrecy (a bit less if you choose to avoid other well-known port numbers).

EDIT: And on a practical level, the port number is sent as plaintext in the packet header, and generally much easier to snoop on than a secret sent in the data.


Not really, because the port is observable over the wire. It’s no bits of secrecy once comms have been watched. That’s the difference between real security and security through obscurity.

Though there is a point to be made to also make obscurity a layer of your defence strat (albeit not effective for all threat models, and brittle).

After all, most organisations dont put out their whole network design, serverpark documentation and infra architecture out in the open. It usually goes by many names, like 'company secret', 'internal knowledge', 'NDA', but in the end its all just obscurity.

For me it just another layer of the onion. I don't really consider it security, though I do qualify it as some sort of defence.


There's a reason militaries don't paint their tanks bright pink...

No one expects camo paint to stop a projectile, that's what the armor is for. But in an ideal scenario you don't get hit by the projectile in the first place, and that's what the camo is for.


Militaries have in the past used bright colours, for good reasons. Muted camo colours being good is a contingent fact dependent on a particular range of technological development, not an absolute law.

Its funny that people who use the phrase security thru obscurity ALWAYS use the secret port as example. I think it's the follow on parroting.


> In reality, all cybersecurity is security thru obscurity.

No, that's not what that word means. "Obscurity" means low/no entropy. If you're leaning on a "secret" int between 0 and 65,536 then it's going to break. If your secret is a random int between 0 and 2^2048 then that's not "obscurity", that's an actual secret.


> the practice of concealing the details or mechanisms of a system to enhance its security

By that Wikipedia definition, Wireguard is more obfuscated than SSH because it won't reveal that it exists to unauthorized users. This enhances its security.

Your example creates a binary that begs the question: how much entropy does it take to advance from obscurity to secret? "Defense in depth" implies many layers of imperfect obfuscation/secrets.


Thank you.

Security through obscurity means "as long as nobody knows our process we're safe"

Which is true in cryptography, knowing that primes are used does not suddenly make it surmountable.

If your security is that the ssh port is x, REGARDLESS of how many bits there are, it's security through obscurity. Someone reading the process would immediately know.

If your process is randomly picking a port, then that's not. You'd have to figure out how to communicate that port to your users though.


Where is obscurity defined as low/no entropy?

unless its 4, of course

RSA actually is security through obscurity, where the obscurity is that nobody will figure out practical factoring.

> In reality, all cybersecurity is security thru obscurity.

I'm usually not here to debate semantics, but good god, trusting in cryptographically secure algorithms is a much stronger promise of security than something like, say, port-knocking.

Just because the math behind these algorithms are being put under a lot more pressure than we could imagine a decade ago doesn't mean we should throw the baby out with the bathwater. If anything, it's a good thing to validate that our assumptions are true, and correct the assumptions we had incorrect.


>I'm usually not here to debate semantics, but good god, trusting in cryptographically secure algorithms is a much stronger promise of security than something like, say, port-knocking.

That’s his point though. That some forms of obscurity are much stronger and aren’t bad.


> There's nothing else but obscurity. The entire field of encryption is literally obscuring.

They're conflating cryptographically secure math with all manners of obscurity through security as being the same. Do you not see how dangerous and silly that claim is?

> A thinking person understands that security, like obscurity, is just a matter of degree, and the only lever you have is increasing the cost for the attacker by increasing obscurity. Security isn't binary, it's a matter of degree in the form of cost.

This doesn't make sense, and honestly sounds like AI-generated ragebait.


The NSA itself has a secret suite of cryptographic primitives for this exact reason.

https://en.wikipedia.org/wiki/NSA_Suite_A_Cryptography


Yes! Thank you for saying this. It bugs me when people don't understand this. Of course, cryptographic obscurity has some measurement of obscurity associated with it, which is why it is valuable.

“Security through obscurity” refers to the algorithm not any key material.

Yes, it refers to it somewhat obscurely.

On a theoretical level no amount of cost will crack a one time pad but since the world is not theoretical, I guess the argument still stands.

Explain how one time pad is security by obscurity.

Because the pad is not visible to those you want to keep the communication secure from. The pad is 'obscured'.


The phrase is imprecise in its meaning. No dictionary definition of obscure would make it apparent. But the point is that some information has to be held back, even if it is only the key. That's what is obscure.

We just call those secrets in the biz.

It's just dark turtles all the way down

This is an absurd reduction and nobody serious things ACLs on source IPs are on the same spectrum as encryption. These things are qualitatively different.

Port knocking or source IP filtering is trivially defeated by an attacker that can observe any traffic in the chain of a legitimate traffic exchange. The entire class of things people call “security through traffic obscurity” are these trivial things that only help against bulk automation.

These are extra things you sprinkle on to buy you more time from 0-day bot farms (not 0-day dedicated attackers who have watched your traffic), but they are not a replacement for real security that gives you well bounded guarantees through cryptography.

The people who think “it’s all security bro” are the ones who end up losing their crypto money when their ISP gets BGP hijacked by a dedicated attacker. “The IP was hardcoded, how could they possibly take over!?!?”


Is a password security through obscurity, since it’s just some not-well-known (known by one) string?

Security through obscurity mostly refers to the attacker not knowing how the system works, not hiding information.


Yes, it is. And code is data. "Security through obscurity" is all that exists.

Cryptography is, in good part, about the practice of using mathematics for the assurance of sufficiently sophisticated obscurity.

The trope of "security through obscurity bad" does not survive scrutiny, because it was never meant to. It's a "practical sense" shorthand, not something to actually deeply consider like this. It falls apart immediately when you do.


Sophisticated obscurity is the key.

Most obscurity is not sophisticated. The things the users are doing aren't much different than a kid hiding behind a sofa and they think their dad doesn't know where they are any longer.


I really do wonder how the cookie will crumble with hardness assumptions in this regard.

The currently trending story may be that it is only a matter of time before the frontier AI labs crack all crypto and then we're hosed, but it's also possible they find hardness proofs and better constructions instead.

Though maybe their focus is not pointing that way right now / counterarguments may continue to be more discoverable.


No, it’s a demonstration of obscurity by design.

It doesn’t back up any claims about the benefits of SBO.


Nothing wrong with security through obscurity, even in its most naive form of changing your port ranges and stuff like that. It's only a problem when some obscurity is the only method of securing.

Obscurity adds layers of security, and security is all about layering and increasing the difficulty, not about some perfect binary solution secure vs not secure.


There's nothing wrong with obscurity, as long as it's not your only line of defence.

Defense-in-depth does not use security-through-obscurity alone, but obscurity can still be a valuable part of a complete strategy. You should know better than "obscurity makes a system less secure"

Layered security*

Security-through-obscurity is another slice of Swiss cheese, albeit one with a big hole.

I would hardly consider that "dangerous."

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.


OpenSSH should cut its pre-auth code or better do what WG does don't talk at all unless the correct secret is presented.

Here is another vulnerability

https://en.wikipedia.org/wiki/XZ_Utils_backdoor


basically nobody was affected since that backdoor wasn't in any distro releases, though

The problem with "hacker news redesigns OpenSSH from first principles" is that's not how the SSH protocol works at all.

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

Eh, many crypto stacks are full of holes and exploits

Yes, so the fewer of them you stack on top of each other the better

It’s been awhile, but there have been exploits. Also constant attempts.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: