How NAT traversal works (2020)
tailscale.com
tailscale.com
It's good to learn about ICE too. I had'nt thought about the security implications : indeed this whole mess makes it very easy for an unprivileged attacker to trick the endpoints into relaying the traffic to their own gateway. For example, if I understand things well, another user behind the NAT can easily make the NAT device relay the traffic to them by sending probes at the same time. I'm not sure how can this be defended against, and if it's even possible.
Is anyone aware of any interesting reading on the subject of MITM of NAT traversal ?
Are there any good software libraries that abstract away all these details
And even if you managed to get past all that. Don't they layer encryption and authentication on top anyways? I know WebRTC uses DTLS and the certificates are exchanged through the signaling channel. So unless you can MITM the signaling channel already (which probably itself uses TLS), it won't get you anything.
In short, I don't think it's particularly interesting.
But indeed, this attack requires us to know when (and where) to start sending probes.
> And even if you managed to get past all that. Don't they layer encryption and authentication on top anyways?
That's true of most network-level MITM attacks, it doesn't mean they are useless, as the layered encryption and authentication is not always properly implemented.
It's an attack leveraging NAT workarounds (like SIP ALG) to potentially access any device behind a NAT by letting a single device load some content sent with the right package sizes and fragmentation properties (say, by publishing a malicious ad).
It involves lots of public-key encrypted random numbers carried in the probe packets. You discard packets that don't match your expectations, and you are safe(ish). If you have to avoid too much public-key encryption and decryption because your cores are slow, it gets more complicated, like establishing beach-heads and using symmetric encryption and, still, random numbers between those while establishing the next level up. But cores are usually fast enough nowadays, even on cheap routers and IOT SOCs.
As long as you have a signal that probing has started, you can just start sending probes : even if their contents are not validated, the NAT device will still define mappings accordingly. The probability distribution for the birthday attack in this configuration is a bit different, but not that much : for 3 devices to get to the same port number, at 4096 probes you get a ~93% probability.
The only way I see would be blocking probes that match an already-received invalid probe, but that creates other problems as it allows an attacker (or even just corrupted packets) to block this communication.
Can we do better? I think we can: if operating systems caught on to capability-based security, then the Web platform could become a legacy platform. (We see that phone OSes, which use capability based security, still direct us to "the app" rather than "the site".) And adoption of IPv6 could void all the kludgy workaround of NAT that we've had to develop.
But we live in the world we inherit, rather than the one we imagine, so currently all we can do is traverse NATs and write webapps.
Worse is better.
And instead of C, we get Javascript.
It is our fault that we use it beyond.
Pascal had null pointers and manual allocation, so was not really any safer than, anyway, C90. Of course C pre-90 lacked even function prototype declarations.
I can now toss code for variant SSH config files, I no longer need port forwarding rules on each router, and I no longer need my DynDNS subscription.
??? My NY computers are inside a university IP space, which simplifies library access. It would be very convenient to sometimes access the web from CA as if I'm using one of my NY computers. I can't determine if/how Tailscale supports this. ???
https://github.com/slackhq/nebula
Disclosure: I wrote and founded ZeroTier. Listed Nebula too for neutrality and completeness.
Such "IP phones" would use UPNP on domestic NATS to forward their port.
Which signaling protocols are able to handle IP/port handover via their signaling servers (in the various mobile network "roaming" contexts)?
Here is one from 2014:
https://www.zerotier.com/2014/08/25/the-state-of-nat-travers...
Here's an earlier one from what seems to be the late 2000s:
https://bford.info/pub/net/p2pnat/
Here's an RFC from 2010 describing not only NAT traversal but a protocol for cryptographic addressing, which is another technique used by both ZeroTier and Tailscale:
https://datatracker.ietf.org/doc/html/draft-ietf-hip-nat-tra...
Here's an RFC for NAT traversal with STUN from 2008:
https://www.rfc-editor.org/rfc/pdfrfc/rfc5389.txt.pdf
I can keep going. I first learned about NAT traversal around 2002 and cryptographic addressing in the mid-2000s.
A lot of ideas in computing get invented and re-invented or at least re-popularized over and over again. Another such idea from networking is zero trust, which was originally called deperimeterisation and was developed by a group called the Jericho Forum in 2003-2005:
https://twitter.com/jonoberheide/status/1505160010371895299
It then got re-invented by Google as BeyondCorp in 2013, then by Forrester and Gartner as Zero Trust most recently. In this case we maybe had to wait for a more confusing term. Deperimeterisation more accurately describes what's happening and there seems to be a rule in networking that prohibits clear language that is not misleading. Zero Trust is a lie since (1) there is no such thing, and (2) the way it's usually deployed today delegates all trust to a single third party like Google or Okta that now has root on the entire universe. This is actually centralized trust.
My intent here is just to remind HN readers that what's new around here is often not new at all. Our field has an incredibly short memory and re-discovers things constantly. I've been on HN since the start and feel like I've watched several generations re-discover things that date back to the 1980s. Hell I watched the entire history of databases get speed run starting with the NoSQL trend (1970s hierarchical data models) and proceeding through the re-discovery of why the RDBMS became popular.
I love the creative acronym