Commit 6646b57
committed
fix,docs: Loopback self-redirect guard + document IP-level gating
Address follow-up review on the transparent listener:
- transparentproxy.dispatch: drop connections whose SO_ORIGINAL_DST is a
loopback address. A genuinely REDIRECTed connection never has a loopback
original destination (the enforce-redirect iptables RETURN loopback before the
REDIRECT), so a loopback dst means a direct dial to the listener port where
SO_ORIGINAL_DST reports the listener's own address — tunnelling to it would
spiral into ever more connections/goroutines. Defense-in-depth.
- HandleTransparentConn: document the gating-key difference. CONNECT gates on
the hostname (r.Host); captured traffic gates on the SO_ORIGINAL_DST IP:port,
so domain-based egress policy does not match captured bypass traffic the way
it matches explicit-proxy traffic. Acceptable while opt-in; the always-on
operator PR must first add SNI-peek for parity or consciously accept IP-level
policy. Tracked as a prerequisite for the default flip.
Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com>
Signed-off-by: Hai Huang <huang195@gmail.com>1 parent cae8cfe commit 6646b57
2 files changed
Lines changed: 26 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
29 | 41 | | |
30 | 42 | | |
31 | 43 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
79 | 93 | | |
80 | 94 | | |
0 commit comments