Re: [dmarc-ietf] indeterminisim of ARC-Seal b= value

Scott Kitterman <sklist@kitterman.com> Tue, 28 March 2017 12:16 UTC

Return-Path: <sklist@kitterman.com>
X-Original-To: dmarc@ietfa.amsl.com
Delivered-To: dmarc@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 69F841294F3 for <dmarc@ietfa.amsl.com>; Tue, 28 Mar 2017 05:16:20 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.002
X-Spam-Level:
X-Spam-Status: No, score=-2.002 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=kitterman.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id eNhKbA8ppsId for <dmarc@ietfa.amsl.com>; Tue, 28 Mar 2017 05:16:18 -0700 (PDT)
Received: from mailout03.controlledmail.com (mailout03.controlledmail.com [IPv6:2607:f0d0:3001:aa::2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 2946112950A for <dmarc@ietf.org>; Tue, 28 Mar 2017 05:16:18 -0700 (PDT)
Received: from kitterma-e6430.localnet (static-72-81-252-22.bltmmd.fios.verizon.net [72.81.252.22]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mailout03.controlledmail.com (Postfix) with ESMTPSA id 9CE4FC401A8 for <dmarc@ietf.org>; Tue, 28 Mar 2017 07:16:16 -0500 (CDT)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=kitterman.com; s=201409; t=1490703376; bh=OcH9tvmVv4d4DvybTWlEjP1Wc+XaL8Il5rrQiTXYQFg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=rgzBwMIbJ/OZObA+lKqu+fMFJbJRWkH6S+8We8uOC3uYwcLNbFiYy9tJH3DL1mv1S 0EalDf2xgSAO+OQ4U+f2lq9XqdwQurR1Js9nx/GgZScEo5Wkay9Djb8I5ENiBpwwF/ A2m5DP610veAjlBjbrxwek+F4V3rVd6ILMwEX58c=
From: Scott Kitterman <sklist@kitterman.com>
To: dmarc <dmarc@ietf.org>
Date: Tue, 28 Mar 2017 08:16:15 -0400
Message-ID: <2009319.9kNPMXJLm6@kitterma-e6430>
User-Agent: KMail/4.13.3 (Linux/3.13.0-112-generic; KDE/4.13.3; x86_64; ; )
In-Reply-To: <CAOj=BA2TUrJ+Ci0WBincwXqJYUjtffvWxkXktK+VbQ-QcKSFvw@mail.gmail.com>
References: <CANtLugO_D1Mz_v_341pc5O1mZ7RhOTrFA3+Ob5-onp72+5uRfA@mail.gmail.com> <2978391.eJVbVTHBlo@kitterma-e6430> <CAOj=BA2TUrJ+Ci0WBincwXqJYUjtffvWxkXktK+VbQ-QcKSFvw@mail.gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="us-ascii"
Archived-At: <https://mailarchive.ietf.org/arch/msg/dmarc/iZEzr8IwT6h-8AtvXy7hpoE-GLo>
Subject: Re: [dmarc-ietf] indeterminisim of ARC-Seal b= value
X-BeenThere: dmarc@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: "Domain-based Message Authentication, Reporting, and Compliance \(DMARC\)" <dmarc.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/dmarc>, <mailto:dmarc-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/dmarc/>
List-Post: <mailto:dmarc@ietf.org>
List-Help: <mailto:dmarc-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/dmarc>, <mailto:dmarc-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 28 Mar 2017 12:16:20 -0000

I will confess to not following all the details on a regular basis, but 
doesn't the paragraph you referenced give a required sequence of multiple 
header fields?  Maybe that's not a problem any more (it's been some years 
since I looked), but that definitely used to be something it was risky to rely 
on.

The test case comment was based on my understanding that you wanted 
deterministic ordering because if the ordering wasn't deterministic it would 
be too hard to test.  I think that can be managed.

Scott K

On Monday, March 27, 2017 10:30:37 PM Peter Goldstein wrote:
> Scott,
> 
> Header reordering is irrelevant to this discussion - the ARC RFC specifies
> in some detail how to construct the ARC Seal from the AMS and AAR headers -
> https://tools.ietf.org/html/draft-ietf-dmarc-arc-protocol-02#section-5.2 .
> And the AMS headers have the same behavior as DKIM - header ordering and
> canonicalization is also well-defined, so header re-ordering doesn't impact
> the signature.  The discussion at hand is literally about the ordering and
> formatting of tag/value pairs within the individual ARC headers.
> 
> So the only brittleness question is whether existing mail infrastructure
> will potentially alter the internal structure of the AMS header or ARC Seal
> header.  That is...unlikely.  We can conclude it's unlikely, because a
> similar alteration of a DKIM signature header would break the DKIM
> signature of forwarded email.  So if DKIM generally works (and it does), we
> should be able to conclude that specifying ordering/formatting of the
> tag/value pairs in an AMS/ARC header does not represent an increase in
> brittleness.
> 
> I'm not really sure I understand the point regarding the # of test cases.
> We're not worried about keeping the # of test cases small - we're
> interested in ensuring that the same test cases will run successfully
> against any valid ARC implementation.  Can you please clarify?
> 
> And yes, something will probably be developed in Ruby at some point - but
> it's just as likely to be a de novo effort, as it is a modification of an
> existing DKIM gem.  There is only 1 pure Ruby DKIM signing gem I'm aware of
> - https://github.com/jhawthorn/dkim - and it hasn't had any updates in 2+
> years and lacks verification logic.  So it's a less than ideal basis for
> developing an ARC gem.
> 
> Best,
> 
> Peter
> 
> On Mon, Mar 27, 2017 at 9:49 PM, Scott Kitterman <sklist@kitterman.com>
> 
> wrote:
> > What's more difficult to is identify all the ways that things get
> > reordered,
> > mangled, etc as they transit the various elements of the mail
> > architecture.
> > If you over specify the allowed order, aren't you risking increasing the
> > brittleness of the solution.
> > 
> > If test cases are automatically generated, then they are cheap and we
> > shouldn't worry about unduly constraining things to keep the number
> > small.  As
> > long as, at some point, the test cases are validated against multiple
> > implementations, I think it's fine.  If you've got a handful of
> > implementations, then the risk of them all having the same bug is pretty
> > low.
> > 
> > In addition to Perl, I'd expect something in Ruby to appear in due course.
> > 
> > Scott K
> > 
> > On Monday, March 27, 2017 07:54:43 PM Peter Goldstein wrote:
> > > John,
> > > 
> > > I'm familiar with the definition of the FWS in the ABNF, as well as the
> > > generic definition ABNF for message headers.  I'm also aware of the
> > > challenges with trying to normalize such headers, and how that can
> > > impact
> > > email authentication - breaking forwarded DKIM signatures and such.  But
> > > none of that is actually relevant here - we are not interested in
> > 
> > arbitrary
> > 
> > > messages.
> > > 
> > > We are interested in creating a set of valid input messages and ensuring
> > > that these messages are signed in a consistent, reliable way by any
> > > valid
> > > ARC implementation.  This is an extremely narrow case - so yes, I do
> > 
> > think
> > 
> > > the above is basically all it would take to make such signature headers
> > > identical.  Perhaps I'll be disappointed, but based on the sample
> > 
> > messages
> > 
> > > I have on hand from existing implementations, that seems unlikely.
> > > 
> > > As for the hypothetical developers who will be adapting DKIM libraries
> > > to
> > > do ARC signing, we've been talking about them since M3AAWG in October
> > > 2015.  So far they haven't materialized.  Honestly, it's not even clear
> > 
> > to
> > 
> > > me that there are that many DKIM libraries out there to adapt.
> > > 
> > > Instead we've seen ~5 implementations (Google, AOL, Dkimpy, OpenARC,
> > > MailerQ), with potential support for implementations in 1-2 additional
> > > languages (e.g. Perl) probably driven by one or more of the implementers
> > 
> > of
> > 
> > > the existing implementations.  It should be relatively easy to
> > > coordinate
> > > such a change across the small number of existing implementations.
> > > 
> > > Best,
> > > 
> > > Peter
> > > 
> > > On Mon, Mar 27, 2017 at 7:21 PM, John R Levine <johnl@taugh.com> wrote:
> > > > I think tightening up some currently allowed ambiguity in the ARC
> > > > 
> > > >> specification is a much simpler and much better solution.  I'm not
> > 
> > sure
> > 
> > > >> why
> > > >> there's such concern about canonicalizing the format and ordering of
> > 
> > some
> > 
> > > >> tag/value pairs.
> > > > 
> > > > If you think that's all it would take to make signature headers
> > 
> > perfectly
> > 
> > > > identical, you will be deeeply disappointed.  (Take a look at FWS in
> > 
> > the
> > 
> > > > ABNF and all of the other generic ABNF for message headers.)
> > > > 
> > > > I think what we've been saying is that the SMTP mail ecosystem has
> > 
> > never
> > 
> > > > tried to make stuff bit-for-bit reproducible, and even if you could
> > 
> > hammer
> > 
> > > > on the spec to make super strict rules for one particular header, it's
> > > > unlikely that the people who are adapting their DKIM code would pay
> > > > attention.
> > > > 
> > > > R's,
> > > > John
> > 
> > _______________________________________________
> > dmarc mailing list
> > dmarc@ietf.org
> > https://www.ietf.org/mailman/listinfo/dmarc