summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2019-10-22 12:51:27 -0400
committerNick Mathewson <nickm@torproject.org>2019-10-22 12:51:27 -0400
commitb588b6087690b2d17fd7f854a3a1b65b569fa79c (patch)
treed64a600c327172ded069a9d3e26911e2bc988dfd
parent9769df89fe5bd8ccd802064273cca09efddc2b02 (diff)
parentbf4a27c0eae79baff7f0ed4ebe12bda5e2ba06b6 (diff)
downloadtor-b588b6087690b2d17fd7f854a3a1b65b569fa79c.tar.gz
tor-b588b6087690b2d17fd7f854a3a1b65b569fa79c.zip
Merge remote-tracking branch 'tor-github/pr/1343' into maint-0.4.1
-rw-r--r--changes/ticket314665
-rw-r--r--src/core/or/connection_edge.c6
2 files changed, 9 insertions, 2 deletions
diff --git a/changes/ticket31466 b/changes/ticket31466
new file mode 100644
index 0000000000..e535b4502e
--- /dev/null
+++ 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
index fe7a8200a3..369a14e889 100644
--- 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;