summaryrefslogtreecommitdiff
path: root/11/97f14f2d5e5e37f28b10b73ba6f729bed51600
blob: b6a991cf8cd7a2ecdc3054872797d062307a8645 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
Received: from sog-mx-2.v43.ch3.sourceforge.com ([172.29.43.192]
	helo=mx.sourceforge.net)
	by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76)
	(envelope-from <moon@justmoon.de>) id 1R4BYe-00039m-23
	for bitcoin-development@lists.sourceforge.net;
	Thu, 15 Sep 2011 13:00:48 +0000
X-ACL-Warn: 
Received: from sulfur.webpack.hosteurope.de ([217.115.142.104])
	by sog-mx-2.v43.ch3.sourceforge.com with esmtp (Exim 4.76)
	id 1R4BYZ-0000C7-7F for bitcoin-development@lists.sourceforge.net;
	Thu, 15 Sep 2011 13:00:47 +0000
Received: from 84-72-69-153.dclient.hispeed.ch ([84.72.69.153]
	helo=[192.168.0.21]); authenticated
	by sulfur.webpack.hosteurope.de running ExIM with esmtpsa
	(TLSv1:AES256-SHA:256)
	id 1R4BYT-00054e-3t; Thu, 15 Sep 2011 15:00:37 +0200
Message-ID: <4E71F6D6.2090208@justmoon.de>
Date: Thu, 15 Sep 2011 15:00:06 +0200
From: Stefan Thomas <moon@justmoon.de>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64;
	rv:6.0.2) Gecko/20110902 Thunderbird/6.0.2
MIME-Version: 1.0
To: bitcoin-development@lists.sourceforge.net
References: <CABsx9T2MKTYCeOqERXKBMYEqNEK4eo9jGt81gZE1=Fv=s3wEqA@mail.gmail.com>
	<CANEZrP3FFEK0xrZqQkPyi8uoyb=XiPU7fSJDcGCLxiGH2uh3dQ@mail.gmail.com>
	<CABsx9T0Eowp6_mTcggCz3tivRL0NsqyyxqingmPzZ2qkJnU9EA@mail.gmail.com>
In-Reply-To: <CABsx9T0Eowp6_mTcggCz3tivRL0NsqyyxqingmPzZ2qkJnU9EA@mail.gmail.com>
Content-Type: multipart/alternative;
	boundary="------------030802040906090000080302"
X-bounce-key: webpack.hosteurope.de;moon@justmoon.de;1316091643;f76c5950;
X-Spam-Score: 1.0 (+)
X-Spam-Report: Spam Filtering performed by mx.sourceforge.net.
	See http://spamassassin.org/tag/ for more details.
	0.0 WEIRD_PORT URI: Uses non-standard port number for HTTP
	1.0 HTML_MESSAGE           BODY: HTML included in message
X-Headers-End: 1R4BYZ-0000C7-7F
Subject: Re: [Bitcoin-development] Request review: drop misbehaving peers
X-BeenThere: bitcoin-development@lists.sourceforge.net
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <bitcoin-development.lists.sourceforge.net>
List-Unsubscribe: <https://lists.sourceforge.net/lists/listinfo/bitcoin-development>,
	<mailto:bitcoin-development-request@lists.sourceforge.net?subject=unsubscribe>
List-Archive: <http://sourceforge.net/mailarchive/forum.php?forum_name=bitcoin-development>
List-Post: <mailto:bitcoin-development@lists.sourceforge.net>
List-Help: <mailto:bitcoin-development-request@lists.sourceforge.net?subject=help>
List-Subscribe: <https://lists.sourceforge.net/lists/listinfo/bitcoin-development>,
	<mailto:bitcoin-development-request@lists.sourceforge.net?subject=subscribe>
X-List-Received-Date: Thu, 15 Sep 2011 13:00:48 -0000

This is a multi-part message in MIME format.
--------------030802040906090000080302
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

A few thoughts:

Should the DoS protection auto-disable if the node has less than a 
minimum number of connections? The idea being that if our node seems to 
be kicking /everybody /off the roster maybe there is something wrong 
with the protections.

It would be nice if the node sent a message to the banned peer with a 
code indicating the reason for the ban, specifically the offense that 
put Bitcoin over the edge. Logging the reason is probably fine for most 
cases, but I wanted to put the idea out there, because it might make 
debugging easier if there are some weird bans happening in the wild and 
we can't figure out why.

Should sending lots of messages that don't pass the protocol-level 
checksum test be a bannable offense? Or generally sending garbage data? 
The attacks I'm thinking of are cross-protocol attacks. So as rough 
example: The attacker puts an iframe on a website with a url like 
http://victim.com:8333 so lots of people's browsers connect to it. Maybe 
he could even use something like [magic-bytes]tx\0[...][valid orphan 
transaction] in the URL, so the browser would send GET /[magic-bytes] 
etc. and the Bitcoin node would interpret it.

kjj wrote:

> A few non-standard transactions are probably legitimate.  A whole bunch
> of them are probably not.  I would think that assigning a point or two
> of badness to a peer sending one is pretty reasonable, with the
> understanding that we would need to adjust that as the network evolves.

Strongly disagree. What is a non-standard transaction today may /be /a 
standard transaction tomorrow.


On 9/15/2011 2:25 PM, Gavin Andresen wrote:
> Thanks Mike, that's exactly the kind of detailed review I was looking
> for.  I think you're right an all points.
>
> I'll simplify:  I'll add a -banscore option (default 100), and if a
> node accumulates more than -banscore misbehavior points it'll get
> dropped and banned for -bantime (default 60*60*24) seconds.
>
> I'll make bad signatures a banning offense, and I'll remove the
> number-of-sigops and non-standard-transaction penalties.
>
> I used a mutable field with const setter to avoid modifying a bunch of
> methods to take non-const blocks/transactions instead of const; I
> think it is appropriate because a block/transaction's DoS score is
> really meta-data and not part of it's state.
>
> I'll make GetTime() unit-test friendly as you suggest.
>


--------------030802040906090000080302
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    A few thoughts:<br>
    <br>
    Should the DoS protection auto-disable if the node has less than a
    minimum number of connections? The idea being that if our node seems
    to be kicking <i>everybody </i>off the roster maybe there is
    something wrong with the protections.<br>
    <br>
    It would be nice if the node sent a message to the banned peer with
    a code indicating the reason for the ban, specifically the offense
    that put Bitcoin over the edge. Logging the reason is probably fine
    for most cases, but I wanted to put the idea out there, because it
    might make debugging easier if there are some weird bans happening
    in the wild and we can't figure out why.<br>
    <br>
    Should sending lots of messages that don't pass the protocol-level
    checksum test be a bannable offense? Or generally sending garbage
    data? The attacks I'm thinking of are cross-protocol attacks. So as
    rough example: The attacker puts an iframe on a website with a url
    like <a class="moz-txt-link-freetext" href="http://victim.com:8333">http://victim.com:8333</a> so lots of people's browsers connect to
    it. Maybe he could even use something like
    [magic-bytes]tx\0[...][valid orphan transaction] in the URL, so the
    browser would send GET /[magic-bytes] etc. and the Bitcoin node
    would interpret it.<br>
    <br>
    kjj wrote:<br>
    <br>
    <blockquote type="cite">
      <pre wrap="">A few non-standard transactions are probably legitimate.  A whole bunch 
of them are probably not.  I would think that assigning a point or two 
of badness to a peer sending one is pretty reasonable, with the 
understanding that we would need to adjust that as the network evolves.</pre>
    </blockquote>
    <br>
    Strongly disagree. What is a non-standard transaction today may <i>be
    </i>a standard transaction tomorrow.<br>
    <br>
    <br>
    On 9/15/2011 2:25 PM, Gavin Andresen wrote:
    <blockquote
cite="mid:CABsx9T0Eowp6_mTcggCz3tivRL0NsqyyxqingmPzZ2qkJnU9EA@mail.gmail.com"
      type="cite">
      <pre wrap="">Thanks Mike, that's exactly the kind of detailed review I was looking
for.  I think you're right an all points.

I'll simplify:  I'll add a -banscore option (default 100), and if a
node accumulates more than -banscore misbehavior points it'll get
dropped and banned for -bantime (default 60*60*24) seconds.

I'll make bad signatures a banning offense, and I'll remove the
number-of-sigops and non-standard-transaction penalties.

I used a mutable field with const setter to avoid modifying a bunch of
methods to take non-const blocks/transactions instead of const; I
think it is appropriate because a block/transaction's DoS score is
really meta-data and not part of it's state.

I'll make GetTime() unit-test friendly as you suggest.

</pre>
    </blockquote>
    <br>
  </body>
</html>

--------------030802040906090000080302--