From 9c34f95b89e8c1c86c8564a40fcd1090180dd686 Mon Sep 17 00:00:00 2001 From: rl1987 Date: Fri, 20 Jul 2018 21:13:38 +0300 Subject: [PATCH 1/3] Scrub IP in channel_tls_process_netinfo_cell() if SafeLogging is on --- src/core/or/channeltls.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/or/channeltls.c b/src/core/or/channeltls.c index 87f5a02b75..96898993c1 100644 --- a/src/core/or/channeltls.c +++ b/src/core/or/channeltls.c @@ -1837,7 +1837,8 @@ channel_tls_process_netinfo_cell(cell_t *cell, channel_tls_t *chan) (int)(chan->conn->link_proto), hex_str(identity_digest, DIGEST_LEN), tor_addr_is_null(&my_apparent_addr) ? - "" : fmt_and_decorate_addr(&my_apparent_addr)); + "" : + safe_str_client(fmt_and_decorate_addr(&my_apparent_addr))); } assert_connection_ok(TO_CONN(chan->conn),time(NULL)); } From a17e9d33781ae56107cfe4b1ece17c1273f8acec Mon Sep 17 00:00:00 2001 From: rl1987 Date: Fri, 20 Jul 2018 21:35:13 +0300 Subject: [PATCH 2/3] Add a sentence to manpage that we may not scrub logs at loglevels below Notice --- doc/tor.1.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/tor.1.txt b/doc/tor.1.txt index 1db8cabf86..0c010d94f2 100644 --- a/doc/tor.1.txt +++ b/doc/tor.1.txt @@ -754,7 +754,9 @@ GENERAL OPTIONS If this option is set to 0, Tor will not perform any scrubbing, if it is set to 1, all potentially sensitive strings are replaced. If it is set to relay, all log messages generated when acting as a relay are sanitized, but - all messages generated when acting as a client are not. (Default: 1) + all messages generated when acting as a client are not. + Note: Tor may not heed this option when logging at log levels below Notice. + (Default: 1) [[User]] **User** __Username__:: On startup, setuid to this user and setgid to their primary group. From dddc9a1715a2101690adb4026be81c2cc1aad671 Mon Sep 17 00:00:00 2001 From: rl1987 Date: Fri, 20 Jul 2018 21:42:45 +0300 Subject: [PATCH 3/3] Add changes file --- changes/bug26882 | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 changes/bug26882 diff --git a/changes/bug26882 b/changes/bug26882 new file mode 100644 index 0000000000..adfe0e2f35 --- /dev/null +++ b/changes/bug26882 @@ -0,0 +1,5 @@ + o Minor bugfixes (logging, documentation): + - When SafeLogging is enabled, scrub IP address in + channel_tls_process_netinfo_cell(). Also, add a note + to manpage that scrubbing is not guaranteed on loglevels + below Notice. Fixes bug 26882; bugfix on 0.2.4.10-alpha.