mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
Add client code to detect attempts to connect to 127.0.0.1 etc
We detect and reject said attempts if there is no chosen exit node or circuit: connecting to a private addr via a randomly chosen exit node will usually fail (if all exits reject private addresses), is always ill-defined (you're not asking for any particular host or service), and usually an error (you've configured all requests to go over Tor when you really wanted to configure all _remote_ requests to go over Tor). This can also help detect forwarding loop requests. Found as part of bug2279.
This commit is contained in:
@@ -1205,9 +1205,11 @@ connection_init_accepted_conn(connection_t *conn, uint8_t listener_type)
|
||||
conn->state = AP_CONN_STATE_SOCKS_WAIT;
|
||||
break;
|
||||
case CONN_TYPE_AP_TRANS_LISTENER:
|
||||
TO_EDGE_CONN(conn)->is_transparent_ap = 1;
|
||||
conn->state = AP_CONN_STATE_CIRCUIT_WAIT;
|
||||
return connection_ap_process_transparent(TO_EDGE_CONN(conn));
|
||||
case CONN_TYPE_AP_NATD_LISTENER:
|
||||
TO_EDGE_CONN(conn)->is_transparent_ap = 1;
|
||||
conn->state = AP_CONN_STATE_NATD_WAIT;
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user