brave / brave-browser

Brave browser for Android, iOS, Linux, macOS, Windows.
https://brave.com
Mozilla Public License 2.0
17.9k stars 2.34k forks source link

Rethink Tor log file management #4629

Open riastradh-brave opened 5 years ago

riastradh-brave commented 5 years ago

There are various messages that a web site can cause to appear in the tor daemon log. For example, it can try to load a .exit URL, an old feature of Tor that has been disabled because it served as a deanonymization vector -- and that triggers a log message at log level WARN.

The tor manual recommends level NOTICE and avoids putting sensitive information -- whatever that means -- in the log at that level. We could reduce the log level to WARN, but that would still include the .exit warnings.

We should:

Prompted by https://hackerone.com/reports/578180.

riastradh-brave commented 5 years ago

To keep it simple, we should keep it in memory and avoid writing to disk at all, but we need to investigate how to capture stderr from a subprocess, and where to put a 'copy to clipboard' operation in the UI.

xiaoyinl commented 5 years ago

@riastradh-brave It seems Tor project has no plan to fix this in their code.

According to the manual, messages can be selected by domains. The ".exit" message is in LP_APP domain, so I think we can raise app domain logging level to "err" and keep other domains at "notice" level.

This is my proposed patch: https://github.com/brave/brave-core/commit/e3871e8f7e1f15fe1320e89978bc5478e7ffd3fb