Implement DomainKeys (DKIM/RFC 6376)
Categories
(MailNews Core :: Security, enhancement)
Tracking
(Not tracked)
People
(Reporter: fareedrizkalla, Unassigned)
References
(Blocks 3 open bugs, )
Details
(Whiteboard: [patchlove][has draft patch])
Attachments
(1 file, 9 obsolete files)
9.67 KB,
patch
|
Details | Diff | Splinter Review |
Comment 1•21 years ago
|
||
![]() |
||
Comment 2•21 years ago
|
||
![]() |
||
Comment 3•20 years ago
|
||
![]() |
||
Comment 4•20 years ago
|
||
Updated•18 years ago
|
Updated•18 years ago
|
![]() |
||
Comment 7•18 years ago
|
||
Assignee | ||
Updated•17 years ago
|
![]() |
||
Comment 10•16 years ago
|
||
![]() |
||
Comment 11•15 years ago
|
||
Updated•15 years ago
|
Comment 12•15 years ago
|
||
Comment 13•15 years ago
|
||
Comment 14•15 years ago
|
||
Comment 15•15 years ago
|
||
Comment 16•15 years ago
|
||
Comment 17•15 years ago
|
||
![]() |
||
Comment 18•15 years ago
|
||
Comment 19•15 years ago
|
||
![]() |
||
Comment 20•15 years ago
|
||
Comment 21•15 years ago
|
||
![]() |
||
Comment 22•15 years ago
|
||
Comment 23•15 years ago
|
||
![]() |
||
Comment 24•15 years ago
|
||
![]() |
||
Comment 25•15 years ago
|
||
Comment 26•15 years ago
|
||
Comment 27•15 years ago
|
||
Comment 28•15 years ago
|
||
Comment 29•15 years ago
|
||
Comment 30•15 years ago
|
||
Comment 31•15 years ago
|
||
Comment 32•15 years ago
|
||
Comment 33•15 years ago
|
||
Comment 34•15 years ago
|
||
Comment 35•15 years ago
|
||
Comment 36•15 years ago
|
||
Comment 37•15 years ago
|
||
![]() |
||
Comment 38•15 years ago
|
||
Comment 39•15 years ago
|
||
![]() |
||
Comment 40•15 years ago
|
||
Comment 41•15 years ago
|
||
![]() |
||
Comment 42•15 years ago
|
||
Comment 43•15 years ago
|
||
Comment 44•15 years ago
|
||
Comment 45•15 years ago
|
||
Comment 46•15 years ago
|
||
Comment 47•15 years ago
|
||
Comment 48•15 years ago
|
||
Updated•15 years ago
|
Comment 49•15 years ago
|
||
Updated•15 years ago
|
![]() |
||
Comment 50•15 years ago
|
||
Comment 51•15 years ago
|
||
![]() |
||
Comment 52•15 years ago
|
||
Comment 53•15 years ago
|
||
Comment 54•15 years ago
|
||
Comment 55•15 years ago
|
||
Comment 56•15 years ago
|
||
Comment 57•15 years ago
|
||
Comment 58•15 years ago
|
||
Comment 59•15 years ago
|
||
![]() |
||
Comment 60•15 years ago
|
||
![]() |
||
Comment 61•15 years ago
|
||
Comment 62•15 years ago
|
||
Comment 63•15 years ago
|
||
Comment 64•15 years ago
|
||
Comment 65•15 years ago
|
||
![]() |
||
Comment 66•15 years ago
|
||
![]() |
||
Comment 67•15 years ago
|
||
![]() |
||
Comment 68•15 years ago
|
||
![]() |
||
Comment 69•15 years ago
|
||
![]() |
||
Comment 70•15 years ago
|
||
Comment 71•15 years ago
|
||
![]() |
||
Comment 72•15 years ago
|
||
Comment 74•14 years ago
|
||
Comment 75•14 years ago
|
||
Comment 76•14 years ago
|
||
Comment 77•14 years ago
|
||
![]() |
||
Comment 78•14 years ago
|
||
![]() |
||
Comment 79•14 years ago
|
||
Comment 80•14 years ago
|
||
![]() |
||
Comment 81•14 years ago
|
||
Comment 82•14 years ago
|
||
![]() |
||
Comment 83•14 years ago
|
||
Comment 84•14 years ago
|
||
![]() |
||
Comment 86•12 years ago
|
||
Updated•8 years ago
|
Comment 87•8 years ago
|
||
Comment 88•8 years ago
|
||
Comment 89•5 years ago
|
||
(In reply to Alessandro Vesely from comment #87)
I'm using Philippe Lieser's DKIM Verifier:
https://addons.mozilla.org/en-US/thunderbird/addon/dkim-verifier/
This addon does not evolve quick enough. And fails every update now.
Making this function a part of TB would be a great enhancement for all users.
Updated•3 years ago
|
Comment 90•1 year ago
|
||
What should Thunderbird do when it can verify that a valid DKIM header is present, and what should it do when it doesn't validate?
Comment 91•11 months ago
|
||
I found it a bit disturbing for some years now, that while my email provider supports the verification of DKIM and SPF, Thunderbird does still not highlight emails with a spoofed sender address. It doesn't even classify them as spam. I just wanted to create a new feature request, but I found this existing ticket. So I will add my suggestions here. (Also mentioning Kai Engert [:KaiE:] as you have asked about the behavior.)
Common Logic
- Add a checkbox to the account/server settings on whether the server supports sender authentication (i.e. the
Authentication-Results
header). It could initially be opt-in, but I think it should eventually be enabled by default. - Thunderbird should scan for the first
Authentication-Results
header when accessing an email. Based on the existence and value of the header, the email is classified into one of the following authentication states:UNSUPPORTED
,NONE
,PASS
,FAIL
.
Here is a description of the individual states:
UNSUPPORTED
: The MTA did not support sender authentication when the email has been received. The state is used when the headerAuthentication-Results
has not been found, or if the header provides no valid information for neither DKIM nor SPF.NONE
: The sender does not support sender authentication. This is used when no authentication took place (e.g.dkim=none
).PASS
: This describes that the email sender was authenticated successfully by either DKIM or SPF.FAIL
: This describes that the email authentication has failed for either DKIM or SPF.
In case of a conflict, I think the reported state should be PASS
or NONE
.
DKIM | SPF | Result | Description |
---|---|---|---|
pass | fail | PASS |
SPF does not work reliably when emails are delivered indirectly. This means spf=fail is rather prone to false-positives. We should therefore trust the result of DKIM in this case. |
fail | pass | NONE |
A successful authentication with SPF should be rather reliable. I would therefore tend to assume a DKIM-misconfiguration on the MTA when observing this scenario. However, introducing a separate state CONFLICTED or even using PASS or FAIL seems plausible to me as well. However, I would avoid using PASS just to make misconfigurations easier to spot for administrators. |
Note that if the checkbox in the server settings is disabled, the state may internally be reported as PASS
for all emails (independent of the header values). In the design described by my comment, Thunderbird behaves exactly the same when the emails pass sender authentication, and when sender authentication has been disabled. However, a separate state may also become useful for additional functionalities.
Email Viewer
If sender authentication is enabled in the server settings and the state is not PASS
, Thunderbird should show a notice above the email content. The notice may look similar to the notice when Thunderbird blocks content of the email for privacy reasons. Here are some suggestions based on the state of the email.
State | Message |
---|---|
UNSUPPORTED |
“The sender address could not be confirmed because your email provider does not seem to support sender authentication. You may hide this notice by disabling sender authentication in the server settings”. |
NONE |
“The sender address could not be confirmed because the sender does not support sender authentication.” |
FAIL |
“The sender address seems to have been spoofed. The sender of the email might not have access to the displayed sender address.” |
In state UNSUPPORTED
, there may also be a quick-action in the notice to disable the option with only one or two clicks. However, such action should only exist on emails which have been received recently. Users should not accidentally disable sender authentication while browsing through old emails from times before their email provider added support.
Spam Detection
Emails in state FAIL
should be marked as spam. While previous messages suggested to mark emails as spam if either DKIM or SPF has failed, I would suggest using the states I have outlines above.
Technicalities
- Thunderbird (MUA) should not perform its own sender authentication. The authentication is the job of the MTA and the result can be accessed using the
Authentication-Results
header. (comment #19) - We should always use the first occurrence of the header as MTAs should add their own headers to the top. If another occurrence is used, we increase the chance an attacker may spoof the result. However, some comments seem to prefer parsing all headers. (comment #16, comment #19, comment #41)
- The header is described by RFC 5451. I did not yet review the RFC in detail. Some adjustments might be made after reading the spec. (comment #10)
- It seems like RFC 5451 wants you to search for the headers with a specific identifier ("authserv-id"). Maybe it makes sense to add an option to configure them. However, I expect just taking the first header would work well in most cases. (comment #23)
- The design described in this comment does intentionally not endorse authenticated senders. The header may be spoofed if the MTA of the receiver does not support sender authentication. Not endorsing successful authentications makes it feasible to enable this feature by default, while suggesting disabling the feature if Thunderbird detects missing support. Note that although Thunderbird may not endorse the sender, the header should be trustworthy if the MTA of the receiver supports sender authentication. (comment #78)
PS: I used the word “sender authentication” mostly due to the lack of better wording. If there is any common phraseology for DKIM and SPF, this should be used instead.
Comment 92•11 months ago
|
||
With respect to Johannes' suggestions, rather than a checkbox I'd suggest a list of domains trusted by the user, when they compare in an Authentication-Results header field as the authserv-id, in a Received-SPF field as the receiver MTA, or in an ARC-Authentication-Results of a verified ARC chain (RFC 8617) as one of the sealing domains. Adding a domain name there means that the user knows that her provider removes spurious A-R fields. It also means that the user understands authentication. Enabling this feature by default might just generate confusion for those who don't understand it. (There are studies concluding that big this-is-phish notices don't prevent users from clicking bad links.)
A checkbox could be used to ask the user if she wants TB to perform DKIM or ARC verifications in case the MTA didn't do it or reported temperror.
DMARC (RFC 7489) specifies the possible relationships between DKIM/SPF and the From header field. It doesn't mention ARC nor other email authentication methods though.
Someone please s/4871/6376/ in the title and /5451/8601/ in the previous message.
Updated•9 months ago
|
Comment 94•9 months ago
|
||
Since a previous comment suggests this, a whitelist of trusted "Authentication-Results" setting domains seems to only work if 1. the provider lists them, and if 2. the provider uses multiple each of them filters out respective unauthorized uses of all used domains rather than just the own one of the respective machine. It seems like some providers don't meet these criteria. I think the alternative and a good default is to parse all headers and display a warning as soon as at least one of them shows a DKIM issue. Picking the first one found doesn't seem to be safe against tampering either.
As soon as any "Authentication-Results" header indicates a problem or as soon as DKIM is entirely missing from an e-mail, I think it's obvious something fishy going on. Those are pretty easy criteria, and Thunderbird doesn't even need to check DKIM locally. A local check can apparently be counter-productive, e.g. if the provider does auto encryption on arrival.
I do find it curious this hasn't been added yet, especially given Thunderbird already has forgery warnings in other situations.
Comment 95•9 months ago
|
||
(In reply to Ellie from comment #94)
Picking the first one found doesn't seem to be safe against tampering either.
While I think I would be fine with parsing all headers and searching for any failure, I would be interested in how parsing only the first header would be vulnerable against tampering. If I understand it correctly, this approach would be vulnerable only if your email provider supports DKIM, but doesn't keep the order of the headers. While keeping the order of headers may not be required by SMTP, I got the impression that the DKIM specification made a rather strong recommendation towards ensuring the order of headers is preserved – even suggesting that DKIM may not work correctly if you don't. I am wondering how many email providers there are which fail to meat this recommendation.
[...] or as soon as DKIM is entirely missing from an e-mail, I think it's obvious something fishy going on.
If DKIM authentication headers are missing entirely, it just means that the email provider didn't support DKIM authentication. Thunderbird should not suggest that emails were spoofed just because the email provider did not support DKIM when the email was received.
(In reply to Alessandro Vesely from comment #92)
Enabling this feature by default might just generate confusion for those who don't understand it. (There are studies concluding that big this-is-phish notices don't prevent users from clicking bad links.)
I would be interested in some literature. I totally see that people would ignore spam notices, as they are known to be unreliable. DKIM results should be much more reliable, through. Besides, even if people ignore such notices, I think it would still be better than what we have right now. While I have the technical knowledge to look at the headers myself, I find it dissatisfying that when people with less technical knowledge ask me, I have to tell them that there is unfortunately no why for them to verify the origin of an email in Thunderbird. There are clearly non-technical people out there who actively seek help to understand how to identify spoofed emails, and right now, Thunderbird just doesn't support that.
Comment 96•9 months ago
|
||
If DKIM authentication headers are missing entirely, it just means that the email provider didn't support DKIM authentication. Thunderbird should not suggest that emails were spoofed just because the email provider did not support DKIM when the email was received.
In my experience, this doesn't reflect modern reality. No DKIM present seems to nearly guarantee dangerous scam, often including crypto extortion and ransom scams. I've rarely encountered present-but-failed DKIM as indicator here. The exception is mailing lists, but advanced users still using these will likely understand, and/or the lists will probably adapt. (Adapt as in rewrite to e-mail list owned send address that the list can DKIM-sign, with e.g. CC smartly used to indicate actual sending user.)
Sorry if I'm mistaken, though. It might be only me.
Comment 97•9 months ago
|
||
(In reply to Ellie from comment #96)
In my experience, this doesn't reflect modern reality. No DKIM present seems to nearly guarantee dangerous scam, often including crypto extortion and ransom scams. I've rarely encountered present-but-failed DKIM as indicator here.
I just realized that we may have misunderstood each other. I was talking about a situation with no Authentication-Results
header. This header should always be added by your email provider, regardless of whether DKIM was supported by the sender. If this header is missing, your email provider doesn't seem to support DKIM verification (or at least not the header to report the result).
If the header is present, but the email has no DKIM signature, that is of course a different scenario. However, I think a missing signature would be reported as a DKIM failure in Authentication-Results
. The header should report dkim=none
only if no DKIM configuration is available via DNS on the domain of the sender. At least that is what I have seen in the past. In other words, when I was talking about DKIM failures, that included scenarios where the sender did not provide a DKIM signature.
With dkim=none
(no DKIM DNS record at the sender domain), there should also be no warning claiming the email has been spoofed, as it simply means that the sender domain doesn't support DKIM. However, a warning that no authentication was performed might be useful.
PS: Note that I haven't differentiated between RFC 6376 (DKIM) and RFC 8601 (Authentication- Results
header) in this and my previous message. I just casually treated them as if they were one specification. I hope nobody got confused by this.
Comment 98•9 months ago
|
||
This header should always be added by your email provider, regardless of whether DKIM was supported by the sender. If this header is missing, your email provider doesn't seem to support DKIM verification (or at least not the header to report the result).
This doesn't seem to be the case either. The providers I've seen only add Authentication-Results if DKIM is present on a per mail basis, otherwise omit it fully. This seems to reflect the OpenDKIM default config ( https://github.com/trusteddomainproject/OpenDKIM/ ). I'd prefer if providers always set it, but most providers likely don't care about some single individual private user asking, and it's not the OpenDKIm default.
And missing DKIM, whether indicated by Authentication-Results or not, often seems to be worst scams. Warnings may seem pertinent then.
Comment 99•9 months ago
|
||
See http://www.opendkim.org/opendkim.conf.5.html "AlwaysAddARHeader", quote: "Normally(!) unsigned mail from non-strict domains does not(!!) cause the results header field to be added." I added the exclamation mark emphasis.
Comment 100•9 months ago
|
||
I instructed the server to set an IMAP keyword based on Authentication-Results, something like so:
if (!/^Authentication-Results:.*=pass\b/:H)
KEYWORDS='nopass';
Then configured TB to gray those messages. In the beginning there where quite some of them. Nowadays they are very rare. (Spammers were the first to learn how to authenticate messages.) The only drawback of tagging gray that way is that a single non-authenticated message in a thread tags the whole thread if it is collapsed. Wouldn't TB do something similar?
The header should report dkim=none only if no DKIM configuration is available via DNS on the domain of the sender.
Nonsense. Some messages may miss a DKIM signature even if the domain supports DKIM, typically DSNs. Also, a failed signature should be treated as if it were not there, but in that case the domain may well support DKIM. Distinguishing such cases makes sense when debugging or doing forensic analyses, but makes no sense in programmatically handling or tagging.
I expect just taking the first header would work well in most cases
Multiple headers can be added by the same MTA or by different MTAs within the same administrative domain, and they can all be relevant. For example, the bastion MTA can perform SPF checks, which are meaningful in most cases, leaving signatures to a downstream host. If both produce A-R fields, SPF won't be the first. Received-SPF header fields are equivalent. There is a real need for the mailbox provider to cooperate by filtering correctly.
Authentication-Results header fields are intrinsically non-exportable from an administrative domain to another. Their signed version, ARC-Authentication-Results, is designed to be exportable, but you have to trust the signing domain besides the authserv-id.
Comment 101•9 months ago
|
||
There is a real need for the mailbox provider to cooperate by filtering correctly.
If that meant the provider setting a clear flag the mail is probably malicious, I agree. But this seems what a missing or negative Authentication-Results header already does. Blocking these emails can be an issue since e.g. mailer-daemon errors, mailing lists, etc. often are still unsigned and interesting to advanced users. But those users still benefit from a clear potential-tampering warning.
Comment 102•9 months ago
|
||
There is a real need for the mailbox provider to cooperate by filtering correctly.
If that meant the provider setting a clear flag the mail is probably malicious, I agree.
I meant eliminating spoofed fields. For example, Courier-MTA renames any Authentication-Results to Old-Authentication-Results before adding its own. Otherwise, a spammer can easily add headers like Authentication-Result: your.trusted.domain; dkim=pass ...
They are not signed.
Updated•2 months ago
|
Updated•2 months ago
|
Description
•