aboutsummaryrefslogtreecommitdiff
path: root/src/or/rendservice.c
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@ev0ke.net>2015-12-08 13:42:27 -0500
committerDavid Goulet <dgoulet@ev0ke.net>2015-12-08 15:57:12 -0500
commit4a7964b3bcfa5439ba10e227c2ca8a4564123538 (patch)
treeab278a1bb2a399c97c76cef979c675c53c0b4f5b /src/or/rendservice.c
parentb701b7962b256ad7c4c43ad191a8ee094613af11 (diff)
downloadtor-4a7964b3bcfa5439ba10e227c2ca8a4564123538.tar.gz
tor-4a7964b3bcfa5439ba10e227c2ca8a4564123538.zip
Don't allow a rendezvous point to have a private address
When an HS process an INTRODUCE2 cell, we didn't validate if the IP address of the rendezvous point was a local address. If it's the case, we end up wasting resources by trying to extend to a local address which fails since we do not allow that in circuit_extend(). This commit now rejects a rendezvous point that has a local address once seen at the hidden service side unless ExtendAllowPrivateAddresses is set. Fixes #8976 Signed-off-by: David Goulet <dgoulet@ev0ke.net>
Diffstat (limited to 'src/or/rendservice.c')
-rw-r--r--src/or/rendservice.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/or/rendservice.c b/src/or/rendservice.c
index 15d98bfde5..aad47bb001 100644
--- a/src/or/rendservice.c
+++ b/src/or/rendservice.c
@@ -1818,6 +1818,18 @@ find_rp_for_intro(const rend_intro_cell_t *intro,
goto err;
}
+ /* Make sure the RP we are being asked to connect to is _not_ a private
+ * address unless it's allowed. Let's avoid to build a circuit to our
+ * second middle node and fail right after when extending to the RP. */
+ if (!extend_info_addr_is_allowed(&rp->addr)) {
+ if (err_msg_out) {
+ tor_asprintf(&err_msg,
+ "Relay IP in INTRODUCE2 cell is private address.");
+ }
+ extend_info_free(rp);
+ rp = NULL;
+ goto err;
+ }
goto done;
err: