{"action":"created","issue":{"url":"https://api.github.com/repos/monero-project/kovri/issues/187","repository_url":"https://api.github.com/repos/monero-project/kovri","labels_url":"https://api.github.com/repos/monero-project/kovri/issues/187/labels{/name}","comments_url":"https://api.github.com/repos/monero-project/kovri/issues/187/comments","events_url":"https://api.github.com/repos/monero-project/kovri/issues/187/events","html_url":"https://github.com/monero-project/kovri/issues/187","id":157370214,"number":187,"title":"NTCP: multiple core issues","user":{"login":"anonimal","id":12156341,"avatar_url":"https://avatars.githubusercontent.com/u/12156341?v=3","gravatar_id":"","url":"https://api.github.com/users/anonimal","html_url":"https://github.com/anonimal","followers_url":"https://api.github.com/users/anonimal/followers","following_url":"https://api.github.com/users/anonimal/following{/other_user}","gists_url":"https://api.github.com/users/anonimal/gists{/gist_id}","starred_url":"https://api.github.com/users/anonimal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anonimal/subscriptions","organizations_url":"https://api.github.com/users/anonimal/orgs","repos_url":"https://api.github.com/users/anonimal/repos","events_url":"https://api.github.com/users/anonimal/events{/privacy}","received_events_url":"https://api.github.com/users/anonimal/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/monero-project/kovri/labels/bug","name":"bug","color":"e11d21"},{"url":"https://api.github.com/repos/monero-project/kovri/labels/critical","name":"critical","color":"eb6420"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-05-29T05:29:43Z","updated_at":"2016-05-29T06:01:37Z","closed_at":null,"body":"**By submitting this issue, I confirm the following:**\r\n\r\n- I have read and understood the [contributor guide](https://github.com/monero-project/kovri/blob/master/doc/CONTRIBUTING.md).\r\n- I have checked that the issue I am reporting can be replicated or that the feature I am suggesting is not present.\r\n- I have checked opened or recently closed [pull requests](https://github.com/monero-project/kovri/pulls) for existing solutions/implementations to my issue/suggestion.\r\n\r\n*Place an X inside the bracket to confirm*\r\n- [X] I confirm.\r\n\r\n---\r\n\r\nUp until very recently, with full knowledge of the quality of this code-base and the many security issues/issues at-large (many of which have been resolved), I had never ran Kovri over clearnet - not once - since the first Kovri commit. That's over 6+ months of non-clearnet development! Instead, I had been using a Tor transproxy to do the myriad of other other critical/major/misc development that was needed - but did not require clearnet access.\r\n\r\nNow that I am regularly developing Kovri over clearnet, core issues have been exposed of which I would have caught earlier had I been able to safely develop over clearnet (I had assumed some of these issues were transproxy-related and I also did not have proper debugging output until fe9654af467ebf8aae16fecf24cda9db39854ada). One of these core issues is an apparently very broken NTCP implementation.\r\n\r\nAn example, as seen in **every** NTCP session (**Edit:** i.e., every session that successfully connects and completes the 4-phase message sequence):\r\n\r\n```\r\n2016:05:29|06:44:40.300303 default:default              NFO             NTCPServer: connected to 184.58.98.218:24234\r\n2016:05:29|06:44:40.300510 default:default              DBG             NTCPSession: [oT4e] 184.58.98.218:24234 *** Phase1, preparing\r\n2016:05:29|06:44:40.300686 default:default              DBG             NTCPSession: [oT4e] 184.58.98.218:24234 <-- Phase1, sending\r\n2016:05:29|06:44:40.300866 default:default              DBG             NTCPSession: [oT4e] 184.58.98.218:24234 *** scheduling termination\r\n2016:05:29|06:44:40.301042 default:default              DBG             NTCPSession: [oT4e] 184.58.98.218:24234 --> Phase1 sent, receiving\r\n2016:05:29|06:44:40.554746 default:default              DBG             NTCPSession: [oT4e] 184.58.98.218:24234 *** Phase2 received, processing\r\n2016:05:29|06:44:40.554968 default:default              DBG             NTCPSession: [oT4e] 184.58.98.218:24234 *** creating shared key\r\n2016:05:29|06:44:40.556551 default:default              DBG             NTCPSession: [oT4e] 184.58.98.218:24234 *** Phase2 successful, proceeding to Phase3\r\n2016:05:29|06:44:40.556774 default:default              DBG             NTCPSession: [oT4e] 184.58.98.218:24234 *** Phase3, preparing\r\n2016:05:29|06:44:40.557208 default:default              DBG             NTCPSession: [oT4e] 184.58.98.218:24234 <-- Phase3, sending\r\n2016:05:29|06:44:40.557440 default:default              DBG             NTCPSession: [oT4e] 184.58.98.218:24234 --> Phase3 sent, receiving Phase4\r\n2016:05:29|06:44:40.741753 default:default              DBG             NTCPSession: [oT4e] 184.58.98.218:24234 *** Phase4 received, processing 64 bytes\r\n2016:05:29|06:44:40.742591 default:default              DBG             NTCPSession: [oT4e] 184.58.98.218:24234 *** Phase4, session connected\r\n2016:05:29|06:44:40.742823 default:default              DBG             NTCPSession: [oT4e] 184.58.98.218:24234 *** processing connected session\r\n2016:05:29|06:44:40.743005 default:default              DBG             NTCPSession: [oT4e] 184.58.98.218:24234 <-- sending TimeSyncMessage\r\n2016:05:29|06:44:40.743187 default:default              DBG             NTCPSession: [oT4e] 184.58.98.218:24234 <-- sending I2NP message\r\n2016:05:29|06:44:40.743658 default:default              DBG             Transports: [oT4e] connecting\r\n2016:05:29|06:44:40.743860 default:default              DBG             NTCPSession: [oT4e] 184.58.98.218:24234 --> receiving payload\r\n2016:05:29|06:44:40.744006 default:default              DBG             NTCPSession: [oT4e] 184.58.98.218:24234 <-- 16 bytes transferred, 16 total bytes sent\r\n2016:05:29|06:44:40.744208 default:default              DBG             NTCPSession: [oT4e] 184.58.98.218:24234 <-- sending I2NP messages\r\n2016:05:29|06:44:40.744437 default:default              DBG             NTCPSession: [oT4e] 184.58.98.218:24234 <-- 704 bytes transferred, 720 total bytes sent\r\n2016:05:29|06:44:40.744616 default:default              DBG             NTCPSession: [oT4e] 184.58.98.218:24234 <-- sending I2NP messages\r\n2016:05:29|06:44:40.744876 default:default              DBG             NTCPSession: [oT4e] 184.58.98.218:24234 <-- 2672 bytes transferred, 3392 total bytes sent\r\n2016:05:29|06:44:40.745062 default:default              DBG             NTCPSession: [oT4e] 184.58.98.218:24234 *** scheduling termination\r\n2016:05:29|06:44:40.745229 default:default              DBG             NTCPSession: [oT4e] 184.58.98.218:24234 *** handling termination timer\r\n2016:05:29|06:44:40.877248 default:default              ERR             NTCPSession: [oT4e] 184.58.98.218:24234 !!! HandleReceived(): 'End of file'\r\n2016:05:29|06:44:40.877482 default:default              NFO             NTCPSession: [oT4e] 184.58.98.218:24234 !!! banning\r\n2016:05:29|06:44:40.877663 default:default              NFO             NTCPServer: [oT4e] 184.58.98.218:24234 has been banned for 70 seconds\r\n2016:05:29|06:44:40.877807 default:default              DBG             NTCPSession: [oT4e] 184.58.98.218:24234 *** terminating session\r\n2016:05:29|06:44:40.878077 default:default              DBG             Transports: disconnecting peer\r\n2016:05:29|06:44:40.878301 default:default              ERR             NTCPServer: ioservice error: 'remote_endpoint: Bad file descriptor'\r\n2016:05:29|06:44:40.878404 default:default              DBG             NTCPServer: running ioservice\r\n```\r\n\r\nSo, at first glance, the issues being:\r\n1. Peer closes connection for currently unknown reasons\r\n2. We ban **every** NTCP peer because of said reason (or simply because they closed the connection). Why do they close the connection and why exactly are we banning? Once we find the reason for 1, we should review *why* we ban.\r\n\r\nAlso,\r\n3. When stopping the router:\r\n```2016:05:29|07:08:59.634290 default:default              DBG             NTCPSession: [] 0.0.0.0:0 *** destroying session```\r\nAt times this can appear a multiple of times, I've seen upwards of 20 times.  Why are sessions being established to ```0.0.0.0:0``` and why so many times?\r\n\r\nAnd lastly,\r\n4. ```NTCPServer``` appears to be incomplete, and also does not process any incoming TCP connections. This is a big. The whole point of P2P is to accept and relay traffic. Kovri is literally running on one leg by only using SSU. Also, our improper NTCP handling may watermark our router to observant peers or ISPs.\r\n\r\nI need more time to review.  Fixes may be simple and/or they may come along with a completed NTCP implementation. I'm labeling this issue as critical because of the potential security implications. Otherwise, it's simply a major bug."},"comment":{"url":"https://api.github.com/repos/monero-project/kovri/issues/comments/222344505","html_url":"https://github.com/monero-project/kovri/issues/187#issuecomment-222344505","issue_url":"https://api.github.com/repos/monero-project/kovri/issues/187","id":222344505,"user":{"login":"anonimal","id":12156341,"avatar_url":"https://avatars.githubusercontent.com/u/12156341?v=3","gravatar_id":"","url":"https://api.github.com/users/anonimal","html_url":"https://github.com/anonimal","followers_url":"https://api.github.com/users/anonimal/followers","following_url":"https://api.github.com/users/anonimal/following{/other_user}","gists_url":"https://api.github.com/users/anonimal/gists{/gist_id}","starred_url":"https://api.github.com/users/anonimal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anonimal/subscriptions","organizations_url":"https://api.github.com/users/anonimal/orgs","repos_url":"https://api.github.com/users/anonimal/repos","events_url":"https://api.github.com/users/anonimal/events{/privacy}","received_events_url":"https://api.github.com/users/anonimal/received_events","type":"User","site_admin":false},"created_at":"2016-05-29T06:01:37Z","updated_at":"2016-05-29T06:01:37Z","body":"To clarify: these issues existed **before** our [first Kovri commit](https://github.com/monero-project/kovri/commit/72ce4157d16df283527e66f2b4e171d039ae907d); so we have always had these issues."}}
{"actor":{"display_login":"anonimal"}}