Client IP address disclosure in smtp.gmail.com
leeholmes.com
leeholmes.com
Gmail and other providers have to split the balance between privacy and security. If you use the web interface and they authenticate your device directly, Google hides your IP and takes responsibility as the "source" of the email. If you're using SMTP it is possible you could be relaying mail for others (even possibly as an open relay) and they will disclose the IP of your client or mail server.
March 9, 2020 – Reported to Google security
March 10-19, 2020 – Assisted with steps to reproduce
March 20, 2020 – Resolved by Google as “Won’t Fix (Intended Behavior)”
March 20-31, 2020 – Worked to confirm that there were no future plans to fix
April 2, 2020 – Got confirmation that the team was aware of the issue and has no plans to fix
Sorry but this is just embarrassing. He wasted so much of his time and time of others while doing 15 sec of googling[1] would solve this.
[0] https://www.quora.com/Does-sending-email-from-Gmail-expose-y...
On the other hand, I've also just reproduced it via test messages from every other one of my email accounts, across multiple providers as well as the various instances I run for my own use. The only one that didn't repro was Office 365.
Another well-known email provider allows you to scrub the IP address, but it isn't clear whether they mean to publicize it. So Google the name of your favorite email provider along with "hide ip address", and see what you can find.
Both Protonmail and Gmail hide the IP if you're using the web interface.
https://protonmail.com/bridge/
tho not clear if dannyw tested with ProtonMail IMAP/SMTP Bridge or with ProtonMail web.
I'm all for privacy and prevention of leaking data such as IP addresses, but there are other concerns, as well, which I often see "privacy advocates" forget about. Maybe there is a better way to solve this problem than including the IP address – I would be all for it – but this post doesn't mention any of this.
Unfortunately, 100% privacy is often open to abuse from malicious actors, and a balance needs to be struck.
BTW: you can make a similar argument about the stamps the post office puts on your letters, which often includes the location and may be "private information".
What's unclear for me it whether this is then stripped by gmail's MSA/MTA before being routed towards the destination. From how I'm reading the article in the OP, it seems to imply that the recipient of the message would know the sender's IP address. If this is the case then I'd say that's of some concern, but it seems people are saying this is NOT the case. Can someone please expand on the exact test setup?
What benefit do we gain from including the origin's IP address throughout the entire header history?
Let's say I'm running an email server for myself for example.com and I receive an email from 192.0.2.1 and it claims to be from bob@gmail.com. Okay, great. First I consult with my database of blacklists to make sure that 192.0.2.1 isn't blacklisted. If it is, into the trash it goes.
The blacklist reports the address is clear, I move to the next step - SPF. I do a DNS lookup for the txt records under gmail.com and find the one for SPF. But lo and behold, the SPF record does not include 192.0.2.1 as a valid address to submit mail on behalf of gmail.com - this email is likely forged. I drop the mail and submit a report to my favorite blacklist provider(s).
Now, could the DNS have been forged? Yes. With modern DNSSEC, is that likely? I don't think so. Could the packet's source address been forged? Yes, that's pretty easy if you're the ISP or state-sponsored. But if the source address has been forged, there's no way the IP address in the SMTP headers are going to do you any good - the attack is too sophisticated at that point.
If a receiver of mail fails to properly validate the source of the email, that onus is on them as far as I'm concerned, especially so if DNSSEC, SPF, DKIM, etc have all been implemented. While open relays aren't extinct, they sure are easy to detect and most best practices I've read on email say to reject them when detected.
I still don't see how having this trail of user IP addresses is useful. There's nothing implicitly in the message that can be trusted - that's what PKI is for.
Source?
>...Or likely ever will be
Source?
This despite the fact that DNSSEC has been under development for twenty five years, with repeated aggressive pushes for deployment.
Indeed, browsers have experimented with DNSSEC support... and then removed DNSSEC support from their builds when they discovered it was unworkable.
This shows the top 25 websites and that none of them have DNSSEC.
As for whether people will in the future, it’s impossible to say for sure. But chrome doesn’t support dnssec, which shows how seriously google takes it.
Edit: Not that I'm saying you should trust quad9 full-stop, but it is a nice feature. Anyone could run their own private resolver but most choose not to because of the very same privacy concerns we're talking about in these headers, namely - making your traffic easier to profile.
Thanks for the discussion!
SPF and DKIM have changed this quite radically. (Not always for the better, e.g. mailing lists traditionally had a legitimate need to set the From: address on the emails they relay. But one can argue that there's little need for those nowadays.)
Or, use a VPN rather than hamstring the ability to validate email or fight spam.