From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id D973E308 for ; Fri, 26 Aug 2016 13:17:36 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-qt0-f173.google.com (mail-qt0-f173.google.com [209.85.216.173]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 12C312F for ; Fri, 26 Aug 2016 13:17:36 +0000 (UTC) Received: by mail-qt0-f173.google.com with SMTP id u25so37495467qtb.1 for ; Fri, 26 Aug 2016 06:17:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=oJSy+3HrFRACq8B1IXC/+4RjlWr9sCtjzJrR4odutR4=; b=zfCvV33PR1NLhbcZyjw01D+rKYSVKGtc6KD+/ejxLmc89UpV/85FvF4NDOXPzEdJCP O6VJB8f6/JuM7eXPoUTQtNDm9hiPggZEQBVOcLtNZ1PhMOIEzG4ZCWa355/lQFGrprzR 8NIrp32T091/96Aie6lBvRf8KnbCK7x0HUQbD+0bC1QkLcoGx089byWR+Os6oLp0DmAS 4hzYgRu0WvYSgWbYDFXq4T7kASJuxTkvprypSqXgqQBe0HtSidOvdsL1HkeK5M/G0cs9 sxi5JjjUX1u2CoLM1Xw+zkap5/gOYPgZxy/N2kec9MI0fSsmlzivM2AYbB8tRLW3Mu4N DRAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=oJSy+3HrFRACq8B1IXC/+4RjlWr9sCtjzJrR4odutR4=; b=CE+3gY/nsEfkp2ADmxuN+HiY+IvllZ9XIBCRrLmHQb0ll9ZreH9qZdKLeQF/3D82dM lbJFOTHw7YUJyGgllMynC/W7FytG/Tg8mNbLMwKjAy3rhsnr0FEVIh5fY6pWdJLzpUC+ M+YdYcCCj96q6cBHxVe7kN1WQTNXNHEmdW/ggtr+SPiHjv2a20a0GIA1ShEfc8zqBcOR KTZzP+tQ5Fyxhs9YlV4/fTlzS66bTtDwAg62903fTw03kN0o+JucKPY3tZ0slpPp7PPA KecPkoxuSv0OZ6ibcZ1Hi7WWk1fmwpb9hlylZ06ax4ej+CFlZdSdStDFisAi6e5+un+X UwWg== X-Gm-Message-State: AE9vXwMcFCN1Z8z0u7MT0JfxFmuR0KdMiwTFDcWwa3izPlW5vuSJakJW5QluMrm8/sDOJCpOxto0/aahh2J6vA== X-Received: by 10.200.50.82 with SMTP id y18mr3161972qta.29.1472217436685; Fri, 26 Aug 2016 06:17:16 -0700 (PDT) MIME-Version: 1.0 Received: by 10.200.46.221 with HTTP; Fri, 26 Aug 2016 06:16:36 -0700 (PDT) In-Reply-To: <339348690.148734.1472089774841@privateemail.com> References: <339348690.148734.1472089774841@privateemail.com> From: Sergio Demian Lerner Date: Fri, 26 Aug 2016 10:16:36 -0300 Message-ID: To: Johnson Lau Content-Type: multipart/alternative; boundary=001a113ff53c58e2f9053af9558c X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,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 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Aug 2016 13:17:37 -0000 --001a113ff53c58e2f9053af9558c Content-Type: text/plain; charset=UTF-8 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 wrote: > Adding witness data to a non-segwit script is invalid by consensus: > > https://github.com/bitcoin/bitcoin/blob/d612837814020ae832499d18e6ee5e > b919a87907/src/script/interpreter.cpp#L1467 > > > This PR will detect such violation early and ban the peer: > > 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. > --001a113ff53c58e2f9053af9558c Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Because there was a discussion on reddit about this t= opic, 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 co= de 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> wrote:
=20

Adding witness data to a non-segwit script is invalid by consensus:=

https://github.com/bitcoin/bitcoin/blob/d612837814020ae832499d18= e6ee5eb919a87907/src/script/interpreter.cpp#L1467


<= /p>

This PR will detect such violation early and ban the peer:

http= s://github.com/bitcoin/bitcoin/pull/8499


A= nother approach is to run the scripts of all incoming transactions. That= 9;s not too bad as you have already=C2=A0fetched the utxos which is a major= part of validation.


--001a113ff53c58e2f9053af9558c--