stop the creator dialing private/internal destinations (#175)

connectTCP and dialCreatorUDP dialed whatever address came over the tunnel, so a joiner could make the creator reach its own LAN, loopback or the metadata ip at 169.254.169.254. dc mode had the same hole so the check lives in common now, all three paths call it. i block everything that isn't global unicast plus RFC1918 and cgnat, and ":80" too - empty host dials the local machine. names get checked inside Dialer.Control, per resolved address right before connect, so a re-resolve can't rebind past it and the dialer keeps its address fallback. with an upstream socks the name is resolved proxy-side, so there only the literal is mine to check. --allow-private-dst brings the old behaviour back.
This commit is contained in:
Sbenazar authored and GitHub committed 2026-09-03 20:20:52 +02:00
1 parent 89d7a474b7
commit 747f8f2312
9 files changed
+108 -21

No files matched your search

+1
View File
@@ -129,6 +129,7 @@
| `--upstream-socks <host:port>` | да | да | да | да | Гнать трафик joiner-а через локальный SOCKS5 прокси, например VPN-клиент |
| `--upstream-user <user>` | да | да | да | да | Логин для upstream SOCKS5 |
| `--upstream-pass <pass>` | да | да | да | да | Пароль для upstream SOCKS5 |
| `--allow-private-dst` | да | да | да | да | Разрешить joiner-у ходить в локальную сеть creator-а (по умолчанию такие адреса блокируются) |
| `--debug` | да | да | да | да | Подробные логи |
| `--version` | да | да | да | да | Вывести версию и выйти |