News for hackers. Stuff that matters.

edechamps

> However, even if SPF failed, and DKIM is passed, it can still be trust worthy.

Yes. The problem is that some senders use SPF+DMARC, but not DKIM. It is fundamentally impossible to forward emails from these senders in a way that will look valid to the recipient.

> if the mail server support ARC(which gmail, for example, does) we can append our ARC so mail provider can look into it to investigate email forwarding chain

The problem with ARC is that just adding the header does nothing on its own; the recipient must also trust the forwarder to provide legitimate authentication results. ARC does not provide any mechanism for that trust to be extended automatically. So unless GMail makes a manual, conscious, explicit business decision to trust Cloudflare, an ARC header added by Cloudflare won't have any effect on GMail recipients.

> Cloudflare Email Routing service acts as an intelligent router at the transport layer, handling and modifying the SMTP envelope to deliver the message at its final destination but preserving the original headers and keeping the body intact. This approach ensures that things like SPF, DKIM, and other security or anti-spam protocols don't break and the recipient stays protected.

My understanding is that this is not technically feasible in some scenarios. Especially the one where the sender has SPF and DMARC, but not DKIM. In that case you can't keep the envelope sender address (SMTP MAIL FROM) as is when forwarding because that would fail SPF at the recipient. But if you rewrite the envelope sender address, then that will fail DMARC at the recipient (due to the SPF Authenticated Identifier being out of alignment with the header From, see RFC 7489). So no matter what you do, the message will fail validation at the recipient. I guess you could change the From header to bring it back into alignment, and that would work because DKIM is not being used, but now the recipient end user will see an incorrect sender address…

If you managed to solve this problem then I'd be really curious to know how!

Re:Tackling Email Spoofing and Phishing on Monday September 27, 2021 @03:59PM (#28675306)
All good points. I would also like to point out that the blog post seems to conflate the "envelope from" (SMTP MAIL FROM) address with the "From: header" address without drawing a distinction between the two.

This is problematic because they are often different in practice, and while SPF acts on the envelope address, DKIM acts on the header address. The recipient typically only sees the header address in their email software. Because of this, SPF on its own is not very useful as a way to avoid spoofing. It does prevent backscatter, however, because bounces are sent to the envelope address.

When a DMARC record is present for the header address domain, the envelope address domain is required to match the header address domain for an SPF check to be considered valid. This makes SPF much more useful when combined with DMARC. Sadly that also makes mail forwarding a harder problem for the same reason - which is interesting given that Cloudflare just started offering an email forwarding service…

While these standards are useful to prevent spoofing, a more practical reason to use them is that end user mail services don't tend to like you very much if you don't. Microsoft (Outlook), for example, is notorious for outright rejecting messages if they don't have valid DMARC.