[Asrg] misconception in SPF

Christian Grunfeld <christian.grunfeld@gmail.com> Thu, 06 December 2012 19:05 UTC

Return-Path: <christian.grunfeld@gmail.com>
X-Original-To: asrg@ietfa.amsl.com
Delivered-To: asrg@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id F2EC021F86AD for <asrg@ietfa.amsl.com>; Thu, 6 Dec 2012 11:05:08 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.999
X-Spam-Level:
X-Spam-Status: No, score=-2.999 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, J_CHICKENPOX_38=0.6, RCVD_IN_DNSWL_LOW=-1]
Received: from mail.ietf.org ([64.170.98.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ihvS4B1UjlVc for <asrg@ietfa.amsl.com>; Thu, 6 Dec 2012 11:05:08 -0800 (PST)
Received: from mail-vb0-f53.google.com (mail-vb0-f53.google.com [209.85.212.53]) by ietfa.amsl.com (Postfix) with ESMTP id 573E521F8432 for <asrg@irtf.org>; Thu, 6 Dec 2012 11:05:08 -0800 (PST)
Received: by mail-vb0-f53.google.com with SMTP id b23so6726135vbz.40 for <asrg@irtf.org>; Thu, 06 Dec 2012 11:05:07 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=uZxr4nLQG+RHpBwbhHn7wCTZZU835xGHcoFRnJiDuMs=; b=Sl1h2nzibip21HKFBzuijx4+y4Rvte+tOS8xFQ+SLV8b1A2i+4ebNwyXnqzfKJKmYF H4Uhprs/bHbagHXgHHwRtooMV8Buf9CpM1x7Uj3flHflxVrO+eDcghm8L8agEVgal5br c+eZr/145b1vPMtwLx5mNLCgWmxNbxt87crAk25GoqrG7kU1ULZgPFa5nyoK88rEgBCO tQScDye4o6D89Uffw9lAFuiSAdcOy6y0R9a/ivL6cwNM3NRLZyzbS5z8l/TZyLYk2KQf z4yBWJlwtJnL4tggGN54g2OqLj2BNuuDDtghE7FgaHDETtue12W40U5Kq4sF6YT6PZSc 0Vag==
MIME-Version: 1.0
Received: by 10.58.168.135 with SMTP id zw7mr2087076veb.4.1354820707625; Thu, 06 Dec 2012 11:05:07 -0800 (PST)
Received: by 10.58.235.131 with HTTP; Thu, 6 Dec 2012 11:05:07 -0800 (PST)
Date: Thu, 06 Dec 2012 16:05:07 -0300
Message-ID: <CAFduga=bjVh+cLLC5xnLR8b=zv7o-QoJtYBCMevEimiPdep0ZA@mail.gmail.com>
From: Christian Grunfeld <christian.grunfeld@gmail.com>
To: Anti-Spam Research Group - IRTF <asrg@irtf.org>
Content-Type: text/plain; charset="ISO-8859-1"
X-Mailman-Approved-At: Thu, 06 Dec 2012 11:55:11 -0800
Subject: [Asrg] misconception in SPF
X-BeenThere: asrg@irtf.org
X-Mailman-Version: 2.1.12
Precedence: list
Reply-To: Anti-Spam Research Group - IRTF <asrg@irtf.org>
List-Id: Anti-Spam Research Group - IRTF <asrg.irtf.org>
List-Unsubscribe: <http://www.irtf.org/mailman/options/asrg>, <mailto:asrg-request@irtf.org?subject=unsubscribe>
List-Archive: <http://www.irtf.org/mail-archive/web/asrg>
List-Post: <mailto:asrg@irtf.org>
List-Help: <mailto:asrg-request@irtf.org?subject=help>
List-Subscribe: <http://www.irtf.org/mailman/listinfo/asrg>, <mailto:asrg-request@irtf.org?subject=subscribe>
X-List-Received-Date: Thu, 06 Dec 2012 19:05:09 -0000

Hi,

Something I found about SPF. I don't know if it is new to you but it
is worth of explanation !

As in all the tutorials of SPF, one stays relaxed when lists hosts/ips
that are authorized to send for the domain and then finally closes
with -all. This is true only for that domain but if there are hosts or
subdomains with A records, they must enforce SPF policies ! (this is
not explicit in RFC or at least confusing).

A single host or subdomain that don't do it can lead to a sender spoofing attack
and pose as someone from our domain without the SPF to detect it.

This is because when we receive mail from foo@bar.mydomain the SPF
protocol seeks TXT records corresponding to bar.mydomain instead of
TXT record for mydomain. If there is an A record for bar.mydomain but
no TXT "v=spf1 -all" for it, SPF returns "none" although SPF exists
for mydomain !

Thus an attacker can inject an email from everywhere claiming that is
from someone@bar.mydomain !

As the default policy of SPF should not be "fail if not present" the
solution is to enforce with the records TXT "v = spf1-all" for each A
record that should not send emails!
This also can be made by means of wildcards but it is discourage in the RFC.

Cheers