-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve default behavior about which Authentication-Results are trusted when enabling ARH reading globally #465
Comments
The expected result you describe it pretty much the opposite form the current intentional behavior, which picks the most "valid" one to show. If you want to have more control over which Authentication-Results header (ARH) is used take a look at https://github.com/lieser/dkim_verifier/wiki/Account-Options#trusted-authentication-servers. Of course if all ARHs contain a fail result, the add-on should not make a valid result out of it. |
What I proposed is the most defensive default behavior I could possibly think of, in case no specific server is marked as trusted. I think that would make the most sense if no server is marked as trusted to fail on whatever fail/none is found anywhere in the chain, since then an attacker could at best only mark themselves as failed (which seems like a bonus if they do, if anything). |
I did some more testing, and for my work e-mail a few hours ago I made the change of making my SMTP strip any external "Authentication-Results" headers which works splendidly as a fix for this. It prevents the addon from picking up any untrusted external headers. However, for my private e-mail I don't have that sort of access to the SMTP server, so it would be nice if in such a situation the default behavior was safer. |
Thanks for providing me the e-mail. Like you noticed yourself already it contained a third ARH that did not show up in your screenshot, where the add-on did pick up the valid result from. I totally agree that the current default behavior could be considered insecure. If one is concerned about such attacks the already mentioned trusted authentication servers needs to be configured for each account! I choose this default because I fear for many it is to complicate if they need to configure this id. I will think more about your proposal, like you may have noticed I'm currently not yet that convinced of it. In some cases (especially for SPF, but also DKIM with e.g. mailing lists) and under the assumption the ARH header is not spoofed, I could imagine cases there one would like to see the more valid result of an earlier ARH (this of course would be best combined with ARC #87). One better default behavior I have been thinking about is trying to guess some reasonable default for the allowed server id from the configured server domain or e-mail address of the account. |
While that is true, it might be pretty safe when ignoring any
It may not need to be, since I think the only "attack" might be an intermediate intentionally(!) trying to make DKIM incorrectly fail, which seems unproblematic. And just guessing a server id seems less safe than failing on any dkim=fail or dkim=none found. My apologies if I'm missing something, however. |
For what it's worth, I just confirmed from digging in my mails that one of my accounts uses multiple subdomains to add in the Authentication-Results header. Therefore, unless it is configured to strip out all other subdomains which I assume it may not be, it's not possible to set a guaranteed safe set of server ids. However, failing on any |
The problem I see with setting multiple hosts A, B is that perhaps an attacker could simply add a fake Authentication-Results header with host B, and the provider host A would perhaps only filter out host A, wouldn't it? So it seems to me like multiple hosts is inherently prone to tampering, while simply failing on any |
I think I now understand what your concern is with setting up a secure manual configuration.
Now if you would configure as trusted The I think relevant parts from the RFC are https://www.rfc-editor.org/rfc/rfc7001#section-1.2, https://www.rfc-editor.org/rfc/rfc7001#section-1.6, https://www.rfc-editor.org/rfc/rfc7001#section-2.4 and https://www.rfc-editor.org/rfc/rfc7001#section-5. The RFC does not explicitly state what must happen. Now if you are talking about wanting to trust multiple But I fail to see how your proposal would help in this case. Now don't get me wrong, your proposal works as a potential better default to the current one of simply trusting all ARHs. All the above is about if your proposal could also improve the security over the already possible manual configuration. |
Yes I agree. While I have some thoughts on the multiple hosts of same provider situation, I don't think it's super relevant due to this point. Users who don't trust their provider to filter out things properly for such a multi domain situation can then just stick with the fail on any failed header default. Edit: for what it's worth, my thoughts are if the RFC doesn't explicitly state this multi host handling, I don't trust the providers to do it. OpenDKIM for example doesn't have the greatest defaults either if you ask me, and this seems like a slightly arcane problem to be aware of. So I'm pessimistic about providers being aware. |
Setup for the bug: Because I use automatic PGP on unencrypted incoming mail provided by the paid e-mail provider I use, I have to disable DKIM checking through the addon itself because the automatic encryption breaks the signature. I therefore have to rely on DKIM Verifier displaying the results of the "Authentication-Results" headers for me. My usual developer e-mail is forwarded through a custom SMTP that I run that adds DKIM check results, and then ends up at an SMTP by a standard paid e-mail provider that also adds DKIM check results before applying Auto-PGP. You can see both of these
Authentication-Results
headers in the chain below, the lower one being from my forwarder SMTP.Expected result: As soon as DKIM Verifier finds any Authentication-Results headers somewhere in the entire chain that say "dkim=fail" or "dkim=none", even if that may also trigger on a spoofed fail result attached by the sender to the return path, that should lead to a fail being displayed.
Actual result: As soon as the top-most Authentication-Results header is present and mentions DKIM, DKIM Verifier seems to display "Valid", even if that very top-most header says "fail". This is with local DKIM check disabled, due to above reasoning.
The text was updated successfully, but these errors were encountered: