summaryrefslogtreecommitdiff
path: root/src/or/rendmid.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2015-04-03 09:38:54 -0400
committerNick Mathewson <nickm@torproject.org>2015-04-03 09:38:54 -0400
commit3781955f079f25f8d6aa47cb746e339497076050 (patch)
tree65520db29b77f5f0af7b6df9ffccec44c4c63013 /src/or/rendmid.c
parent9063f29160615b379f907009e7158f1fcf1ed84c (diff)
parent01e4bc80cd75bbf2a4ce3b18ff17550eed993bb0 (diff)
downloadtor-3781955f079f25f8d6aa47cb746e339497076050.tar.gz
tor-3781955f079f25f8d6aa47cb746e339497076050.zip
Merge remote-tracking branch 'origin/maint-0.2.4' into maint-0.2.5
Diffstat (limited to 'src/or/rendmid.c')
-rw-r--r--src/or/rendmid.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/or/rendmid.c b/src/or/rendmid.c
index d89cdf6bed..0e1f91c302 100644
--- a/src/or/rendmid.c
+++ b/src/or/rendmid.c
@@ -149,6 +149,20 @@ rend_mid_introduce(or_circuit_t *circ, const uint8_t *request,
goto err;
}
+ /* We have already done an introduction on this circuit but we just
+ received a request for another one. We block it since this might
+ be an attempt to DoS a hidden service (#15515). */
+ if (circ->already_received_introduce1) {
+ log_fn(LOG_PROTOCOL_WARN, LD_REND,
+ "Blocking multiple introductions on the same circuit. "
+ "Someone might be trying to attack a hidden service through "
+ "this relay.");
+ circuit_mark_for_close(TO_CIRCUIT(circ), END_CIRC_REASON_TORPROTOCOL);
+ return -1;
+ }
+
+ circ->already_received_introduce1 = 1;
+
/* We could change this to MAX_HEX_NICKNAME_LEN now that 0.0.9.x is
* obsolete; however, there isn't much reason to do so, and we're going
* to revise this protocol anyway.