should accept dkim based on from address and signing address belonging to the same person

Bug #643223 reported by Martin Pool
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
High
Martin Pool

Bug Description

Following on from bug 316272 and https://dev.launchpad.net/LEP/DKIMAuthenticatedMail

It's fairly common for people to send mail from <email address hidden> with a From address of <email address hidden>. We could accept this as strongly authenticated if all of the following are true:

 * the mail has a valid dkim signature
 * the dkim signing domain matches the Sender address
 * there is a Launchpad account P with active email addresses for both the Sender and From addresses
 * the dkim signature covers both the From and Sender fields (is this needed?)

This could perhaps be simplified to

 * the mail has a valid dkim signature
 * the signature covers the Sender field
 * there is an account with active email address matching the Sender field

then we consider it strongly authenticated as coming from the sender.

Related branches

Revision history for this message
Scott Kitterman (kitterman) wrote :

You want to limit DKIM to cases where the signing domain (d=) matches the From domain in the body of the message. Looking at Sender and ignoring From puts the identity precedence backwards. It is not unheard of for mailing lists to add a sender header and for mailing lists to add DKIM signatures. If there were a mailing list hosted under the domain in question, relying on Sender might allow malicious commands to be authenticated:

1. Sign up for mailing list on target domain.
2. Send message to mailing list (LP won't get this because it's not subscribed).
3. Collect message plus signature from mailing list.
4. Replay message with rcpt to LP.
5. Profit.

Keep in mind that envelope identities like rcpt to are not bound to DKIM signatures and so replay like this is trivial. It's not currently done because it's not valuable to do so. Please don't make it valuable to do so.

Revision history for this message
Gary Poster (gary) wrote :

If I understand Scott's concerns correctly, this means that Martin's first set of bullet points (which includes "there is a Launchpad account P with active email addresses for both the Sender and From addresses" and "the dkim signature covers both the From and Sender fields") is OK, but the simplified version he proposed is not. Please correct or confirm.

Changed in launchpad-foundations:
status: Confirmed → Incomplete
Revision history for this message
Scott Kitterman (kitterman) wrote :

Right. Including Sender would open up the concern that I've mentioned. If you look at the DomainKeys policy element you'll see it included Sender. For the DKIM policy element, ADSP, it does not include sender due to this exact concern.

Revision history for this message
Martin Pool (mbp) wrote : Re: [Bug 643223] Re: should accept dkim based on from address and signing address belonging to the same person

I'm fine with only doing the first case, ie checking both From and
Sender are validated addresses for the same account.

On 20 September 2010 16:41, Scott Kitterman <email address hidden> wrote:
> You want to limit DKIM to cases where the signing domain (d=) matches
> the From domain in the body of the message.  Looking at Sender and
> ignoring From puts the identity precedence backwards.  It is not unheard
> of for mailing lists to add a sender header and for mailing lists to add
> DKIM signatures.  If there were a mailing list hosted under the domain
> in question, relying on Sender might allow malicious commands to be
> authenticated:
>
> 1. Sign up for mailing list on target domain.
> 2. Send message to mailing list (LP won't get this because it's not subscribed).
> 3. Collect message plus signature from mailing list.
> 4. Replay message with rcpt to LP.
> 5. Profit.
>
> Keep in mind that envelope identities like rcpt to are not bound to DKIM
> signatures and so replay like this is trivial.  It's not currently done
> because it's not valuable to do so.  Please don't make it valuable to do
> so.

I don't see the vulnerability in this example. I think this would
mean there was a message with Sender: <email address hidden> From:
<email address hidden>, with both fields signed by example.com.
This is only a problem if Impersonated has already, through the web
ui, added <email address hidden> as one of their email addresses?

--
Martin

Revision history for this message
Martin Pool (mbp) wrote :

I think we now agree on what would be done to close this bug, therefore moving it out of incomplete.

Changed in launchpad-foundations:
status: Incomplete → Confirmed
Gary Poster (gary)
Changed in launchpad-foundations:
status: Confirmed → Triaged
Jonathan Lange (jml)
Changed in launchpad-foundations:
importance: Low → High
Martin Pool (mbp)
Changed in launchpad-foundations:
assignee: nobody → Martin Pool (mbp)
Revision history for this message
Martin Pool (mbp) wrote :
Changed in launchpad:
status: Triaged → In Progress
Revision history for this message
Launchpad QA Bot (lpqabot) wrote :
tags: added: qa-needstesting
Changed in launchpad:
status: In Progress → Fix Committed
Revision history for this message
Martin Pool (mbp) wrote :

With help from Haw I tested this on qastaging:

 * mail From my gmail address: accepted
 * mail From my canonical address, via gmail, signed by gmail: accepted (the point of this bug)
 * unsigned mail attempting to create a new bug: rejected
 * gpg signed attempting to create a new bug: accepted
 * unsigned mail appending to an existing bug (weak auth ok): also accepted

so it looks all ok.

There is a follow-on <https://code.launchpad.net/~mbp/launchpad/mail-script/+merge/75488> but it only affects developer tools and doesn't need qa.

tags: added: qa-ok
removed: qa-needstesting
William Grant (wgrant)
Changed in launchpad:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.