summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohnson Lau <jl2012@xbt.hk>2016-09-01 07:29:29 -0400
committerbitcoindev <bitcoindev@gnusha.org>2016-09-01 11:29:38 +0000
commitd9608835e50bb3e01250841b63ccdd9fe4653d66 (patch)
treec8f9d9415cebe2518639aa772c63b9f191fdeb73
parentb43355589210a10750c12f409a33ab6bcf97792f (diff)
downloadpi-bitcoindev-d9608835e50bb3e01250841b63ccdd9fe4653d66.tar.gz
pi-bitcoindev-d9608835e50bb3e01250841b63ccdd9fe4653d66.zip
Re: [bitcoin-dev] Attack by modifying non-segwit transactions after segwit is accepted ?
-rw-r--r--ab/2a033926e9791a135337235db7dce4e39b24a4145
1 files changed, 145 insertions, 0 deletions
diff --git a/ab/2a033926e9791a135337235db7dce4e39b24a4 b/ab/2a033926e9791a135337235db7dce4e39b24a4
new file mode 100644
index 000000000..330407d3d
--- /dev/null
+++ b/ab/2a033926e9791a135337235db7dce4e39b24a4
@@ -0,0 +1,145 @@
+Return-Path: <jl2012@xbt.hk>
+Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org
+ [172.17.192.35])
+ by mail.linuxfoundation.org (Postfix) with ESMTPS id 8E819483
+ for <bitcoin-dev@lists.linuxfoundation.org>;
+ Thu, 1 Sep 2016 11:29:38 +0000 (UTC)
+X-Greylist: from auto-whitelisted by SQLgrey-1.7.6
+Received: from erelay3.ox.registrar-servers.com
+ (erelay3.ox.registrar-servers.com [192.64.117.2])
+ by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 46D5B139
+ for <bitcoin-dev@lists.linuxfoundation.org>;
+ Thu, 1 Sep 2016 11:29:35 +0000 (UTC)
+Received: from localhost (unknown [127.0.0.1])
+ by erelay1.ox.registrar-servers.com (Postfix) with ESMTP id
+ 60ACA2207E0A; Thu, 1 Sep 2016 11:29:32 +0000 (UTC)
+Received: from erelay1.ox.registrar-servers.com ([127.0.0.1])
+ by localhost (erelay.ox.registrar-servers.com [127.0.0.1]) (amavisd-new,
+ port 10024)
+ with LMTP id cLgkTYEFsoW6; Thu, 1 Sep 2016 07:29:29 -0400 (EDT)
+Received: from MTA-07.privateemail.com (unknown [10.20.150.170])
+ (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits))
+ (No client certificate requested)
+ by erelay1.ox.registrar-servers.com (Postfix) with ESMTPS id
+ C52D22207DA3; Thu, 1 Sep 2016 07:29:29 -0400 (EDT)
+Received: from APP-06 (unknown [10.20.147.156])
+ (using TLSv1 with cipher AES256-SHA (256/256 bits))
+ (No client certificate requested)
+ by MTA-07.privateemail.com (Postfix) with ESMTPSA id 828E160032;
+ Thu, 1 Sep 2016 11:29:29 +0000 (UTC)
+Date: Thu, 1 Sep 2016 07:29:29 -0400 (EDT)
+From: Johnson Lau <jl2012@xbt.hk>
+Reply-To: Johnson Lau <jl2012@xbt.hk>
+To: Sergio Demian Lerner <sergio.d.lerner@gmail.com>
+Message-ID: <1348417205.55392.1472729369522@privateemail.com>
+In-Reply-To: <CAKzdR-oMEe6rcusn5kajZHvWXEkneywsNEJpooss76o9WuhDxg@mail.gmail.com>
+References: <CAKzdR-q4hagujzWxJxmwpxJUQFLe7SKukbDNs=_S_VKgJ9N_TA@mail.gmail.com>
+ <339348690.148734.1472089774841@privateemail.com>
+ <CAKzdR-oMEe6rcusn5kajZHvWXEkneywsNEJpooss76o9WuhDxg@mail.gmail.com>
+MIME-Version: 1.0
+Content-Type: multipart/alternative;
+ boundary="----=_Part_55391_974684541.1472729369462"
+X-Priority: 3
+Importance: Medium
+X-Mailer: Open-Xchange Mailer v7.8.1-Rev19
+X-Originating-Client: open-xchange-appsuite
+X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,HTML_MESSAGE,
+ RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1
+X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on
+ smtp1.linux-foundation.org
+Cc: Bitcoin Protocol Discussion <bitcoin-dev@lists.linuxfoundation.org>
+Subject: Re: [bitcoin-dev] Attack by modifying non-segwit transactions after
+ segwit is accepted ?
+X-BeenThere: bitcoin-dev@lists.linuxfoundation.org
+X-Mailman-Version: 2.1.12
+Precedence: list
+List-Id: Bitcoin Protocol Discussion <bitcoin-dev.lists.linuxfoundation.org>
+List-Unsubscribe: <https://lists.linuxfoundation.org/mailman/options/bitcoin-dev>,
+ <mailto:bitcoin-dev-request@lists.linuxfoundation.org?subject=unsubscribe>
+List-Archive: <http://lists.linuxfoundation.org/pipermail/bitcoin-dev/>
+List-Post: <mailto:bitcoin-dev@lists.linuxfoundation.org>
+List-Help: <mailto:bitcoin-dev-request@lists.linuxfoundation.org?subject=help>
+List-Subscribe: <https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev>,
+ <mailto:bitcoin-dev-request@lists.linuxfoundation.org?subject=subscribe>
+X-List-Received-Date: Thu, 01 Sep 2016 11:29:38 -0000
+
+------=_Part_55391_974684541.1472729369462
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 7bit
+
+Thank you so much for taking time to actually review the codes. I hope you will keep raising questions when you feel something might be wrong. This is how things supposed to work and we should not be affected by some forum discussions.
+
+> On August 26, 2016 at 9:16 AM Sergio Demian Lerner <sergio.d.lerner@gmail.com> wrote:
+>
+> Because there was a discussion on reddit about this topic, I want to clarify that Johnson Lau explained how a check in the code prevents this attack.
+> So there is no real attack.
+>
+> Also note that the subject of this thread has a question mark, which means that I'm asking the community for clarification, not asserting the existence of a vulnerability.
+>
+> The segwit code is complex, and some key parts of the consensus code are spread over the source files (such as state.CorruptionPossible() relation to DoS banning, IsNull() check in witness program serialization, etc.).
+>
+> Thanks again Johnson for your clarifications.
+>
+>
+> On Wed, Aug 24, 2016 at 10:49 PM, Johnson Lau <jl2012@xbt.hk mailto:jl2012@xbt.hk > wrote:
+>
+> > >
+> > Adding witness data to a non-segwit script is invalid by consensus:
+> >
+> > https://github.com/bitcoin/bitcoin/blob/d612837814020ae832499d18e6ee5eb919a87907/src/script/interpreter.cpp#L1467 https://github.com/bitcoin/bitcoin/blob/d612837814020ae832499d18e6ee5eb919a87907/src/script/interpreter.cpp#L1467
+> >
+> >
+> > This PR will detect such violation early and ban the peer:
+> >
+> > https://github.com/bitcoin/bitcoin/pull/8499 https://github.com/bitcoin/bitcoin/pull/8499
+> >
+> >
+> >
+> >
+> > Another approach is to run the scripts of all incoming transactions. That's not too bad as you have already fetched the utxos which is a major part of validation.
+> >
+> > >
+>
+
+------=_Part_55391_974684541.1472729369462
+MIME-Version: 1.0
+Content-Type: text/html; charset=UTF-8
+Content-Transfer-Encoding: quoted-printable
+
+<!DOCTYPE html>
+<html><head>
+ <meta charset=3D"UTF-8">
+</head><body><p>Thank you so much for taking time to actually review the co=
+des. I hope you will&#160;keep raising questions when you feel something mi=
+ght be wrong. This is how things supposed to work and we should&#160;not be=
+ affected by some forum discussions.</p><blockquote type=3D"cite">On August=
+ 26, 2016 at 9:16 AM Sergio Demian Lerner &#60;sergio.d.lerner@gmail.com&#6=
+2; wrote:<br><br><div dir=3D"ltr"><div>Because there was a discussion on re=
+ddit about this topic, I want to clarify that Johnson Lau explained how a c=
+heck in the code prevents this attack.<br></div><div>So there is no real at=
+tack.<br></div><div><br></div><div>Also note that the subject of this threa=
+d has a question mark, which means that I&#39;m asking the community for cl=
+arification, not asserting the existence of a vulnerability.<br><br></div><=
+div>The segwit code is complex, and some key parts of the consensus code ar=
+e spread over the source files (such as state.CorruptionPossible() relation=
+ to DoS banning, IsNull() check in witness program serialization, etc.). <b=
+r><br></div><div>Thanks again Johnson for your clarifications.<br></div><di=
+v><br></div></div><div class=3D"ox-455267db53-gmail_extra"><br><div class=
+=3D"ox-455267db53-gmail_quote">On Wed, Aug 24, 2016 at 10:49 PM, Johnson La=
+u &#60;<a href=3D"mailto:jl2012@xbt.hk" target=3D"_blank">jl2012@xbt.hk</a>=
+&#62; wrote:<br><blockquote><u></u><div><p>Adding witness data to a non-seg=
+wit script is invalid by consensus:</p><p><a href=3D"https://github.com/bit=
+coin/bitcoin/blob/d612837814020ae832499d18e6ee5eb919a87907/src/script/inter=
+preter.cpp#L1467" target=3D"_blank">https://github.com/bitcoin/<wbr/>bitcoi=
+n/blob/<wbr/>d612837814020ae832499d18e6ee5e<wbr/>b919a87907/src/script/<wbr=
+/>interpreter.cpp#L1467</a></p><p><br></p><p>This PR will detect such viola=
+tion early and ban the peer:</p><p><a href=3D"https://github.com/bitcoin/bi=
+tcoin/pull/8499" target=3D"_blank">https://github.com/bitcoin/<wbr/>bitcoin=
+/pull/8499</a></p><p>&#160;<br></p><p><br></p><p>Another approach is to run=
+ the scripts of all incoming transactions. That&#39;s not too bad as you ha=
+ve already&#160;fetched the utxos which is a major part of validation.</p><=
+/div></blockquote></div><br></div></blockquote></body></html>
+=20
+------=_Part_55391_974684541.1472729369462--
+