tor

The Tor anonymity network
git clone https://git.dasho.dev/tor.git
Log | Files | Refs | README | LICENSE

commit 37c616aeaf21fc54a367361272e5f1fc84d4a508
parent d6d3e829dd20b78e2b80e52f0e3865a1002e653b
Author: Nick Mathewson <nickm@torproject.org>
Date:   Wed, 18 Sep 2019 15:48:25 -0400

Merge branch 'bug31466_035' into bug31466_042

Diffstat:
Achanges/ticket31466 | 5+++++
Msrc/core/or/connection_edge.c | 6++++--
2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/changes/ticket31466 b/changes/ticket31466 @@ -0,0 +1,5 @@ + o Minor bugfixes (logging): + - Rate-limit our the logging message about the obsolete .exit notation. + Previously, there was no limit on this warning, which could potentially + be triggered many times by a hostile website. Fixes bug 31466; + bugfix on 0.2.2.1-alpha. diff --git a/src/core/or/connection_edge.c b/src/core/or/connection_edge.c @@ -1611,8 +1611,10 @@ connection_ap_handshake_rewrite(entry_connection_t *conn, * disallowed when they're coming straight from the client, but you're * allowed to have them in MapAddress commands and so forth. */ if (!strcmpend(socks->address, ".exit")) { - log_warn(LD_APP, "The \".exit\" notation is disabled in Tor due to " - "security risks."); + static ratelim_t exit_warning_limit = RATELIM_INIT(60*15); + log_fn_ratelim(&exit_warning_limit, LOG_WARN, LD_APP, + "The \".exit\" notation is disabled in Tor due to " + "security risks."); control_event_client_status(LOG_WARN, "SOCKS_BAD_HOSTNAME HOSTNAME=%s", escaped(socks->address)); out->end_reason = END_STREAM_REASON_TORPROTOCOL;