diff options
author | Nick Mathewson <nickm@torproject.org> | 2015-04-03 09:39:19 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2015-04-03 09:39:19 -0400 |
commit | c1b36488e9c318fc414220e8549624b423560ad2 (patch) | |
tree | 8f1b915a05ee1e8f20e0473aba52314c7413ec70 /src/or | |
parent | b117a06784b6e00fb929465e44e520494ac0c617 (diff) | |
parent | 3781955f079f25f8d6aa47cb746e339497076050 (diff) | |
download | tor-c1b36488e9c318fc414220e8549624b423560ad2.tar.gz tor-c1b36488e9c318fc414220e8549624b423560ad2.zip |
Merge remote-tracking branch 'origin/maint-0.2.5' into maint-0.2.6
Diffstat (limited to 'src/or')
-rw-r--r-- | src/or/or.h | 3 | ||||
-rw-r--r-- | src/or/rendmid.c | 14 |
2 files changed, 17 insertions, 0 deletions
diff --git a/src/or/or.h b/src/or/or.h index 6723f93f77..0d81b54d94 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -3181,6 +3181,9 @@ typedef struct or_circuit_t { * to the specification? */ unsigned int remaining_relay_early_cells : 4; + /* We have already received an INTRODUCE1 cell on this circuit. */ + unsigned int already_received_introduce1 : 1; + /** True iff this circuit was made with a CREATE_FAST cell. */ unsigned int is_first_hop : 1; diff --git a/src/or/rendmid.c b/src/or/rendmid.c index 9f6ff86c47..2451acb514 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. |