Welcome. We're going to be talking about some email stuff today. A couple of disclaimers. There's going to be a number of disclaimers throughout the talk. First two tend to curse a lot during presentations. I'm going to try to curb it to an absolute minimum because I know it can be annoying. Number two is I'm going to be going very fast throughout these slides, so just bear with me. I have a lot of content. It was really hard to push this to 80 slides in 45 minutes, but unfortunately, because of the timeline and everything, it was almost impossible. Really quickly, who am I? My name is Marcello. I go by Bipe Leader a little bit everywhere. I'm an open source developer, researcher, engineer. I like to call myself an Infinity Stones teamer because I collected all the colors. And hey, fresh off the press, I'm looking for a new gig, so if you're hiring, come grab me after the talk. Even if you're not hiring, come grab me after the talk and chat. I'm a friendly guy. I like talking to people. Second, this third disclaimer, rather, please don't do crimes. This is going to be apparent when I'm saying this towards the end of the talk, but you're just going to get in trouble. And yeah, please don't. I know doing that here is like going to a heroin convention and asking them not to do heroin, but, you know, just please don't. So how did this all get started? I just wanted to send an e-mail, programmatically and through a Cloudflare worker. If you're asking yourself why through a Cloudflare worker, it's because I backed myself in a corner from a tech stack perspective. I had no other option. I built this entire backend website using Cloudflare workers because I wanted to be the hip person, you know, using the latest stuff. And if you're not familiar with Cloudflare workers, they're like sort of akin to AWS Lambdas, so it's a serverless computing platform. And it's a little bit edgy, though, in the sense that, like, there's a twist to the Cloudflare solution, which is, like, they take your code and they distribute it automatically throughout their CDN, so it's always, like, the person hitting your service is always latency-optimized. Like, you know, it's always, like, you know, it's always, like, geographically to where you're trying to hit the service. And you can also only write them in JavaScript, TypeScript, and anything that emits WebAssembly, so they're also slightly depressed as well because they can only be living in TypeScript land. This is basically how you start out with Cloudflare workers. You basically just run a command, creates a directory structure, then Cloudflare provides a tool called Wrangler that automatically, like, you can use it to manage and upload your Wrangler and your worker code. And then your worker code is just automatically available at an HTTPS-enabled URL that everybody can access. And the main takeaway here is that, by default, the worker code is public because, like, that's the whole point. Like, people need one and access your service so they can use it, right? So just for some context here, this is, like, you know, imagine, like, 1 a.m., you know, I'm just trying to work on this freaking website. I want to go to bed so I can actually get to my day job, you know? It's late, maybe even a little drunk. And I just need this website backend to send an email, right? So I'm just drunkenly, like, Googling, you know, send email Cloudflare workers. And I stumble across this blog post from Cloudflare. It's like, send email using workers with something called mail channels. I've never heard of whatever mail channels is, but at the time I didn't care. Hey, it's got code. Great. Copy-paste this thing into my worker. Works. First try. And we'll go back to that code in a second. But it's, like, you know, it's, like, it works first try, which in hindsight, red flag. Nothing really ever works first try. But, hey, I get an email, and it goes to my spam inbox, which is somewhat normal, I think, right? Because I didn't set up any email security stuff, which I had very little about at the time. But, yeah, hey. So I leave this behind, like, come back a couple days later, and I see that there was an open browser tab, like, throughout the gazillions that I had open from when I was working on this a couple days ago, where there's this person asking on the Cloudflare community forum, like, hey, can I get an email from you? Or I'm saying, hey, so, like, if I use this feature, this mail channels thing, like, doesn't this allow anybody to impersonate my domain and send emails from my domain? And I'm, like, why, as the kids say, that's pretty sus, right? Why are you even asking that? Like, that's a weird question to be asking just randomly out of the blue. And then there's a mail channels person, and they're saying, yeah, this is just how the email works, though. So, like, you know, there's nothing really going to do about it. Which, at this point, I'm completely nerd sniped. So I just keep Googling, like, what's going on with this mail channels thing. I've never heard of this before. And a bunch of people asking a little bit all over the place, hey, like, can't people just impersonate my domain with this? And I'm, like, okay, well, what's going on? And then there's this guy on Reddit that's, like, hey, like, asks a really important question, because I didn't even think of this. Like, why is this free? Like, why aren't you monetizing this? Like, this seems weird. Like, you're just allowing people to send emails for free? And they're, like, yeah, no, no, no, we don't care about the money, right? We just care. about sending an email. It's fine. So they just went full joker. So I'm, like, okay, let me just go back to the code that I just, like, in my sleepless stupor just copy-pasted into my worker code. And I stare at this for, like, a good two minutes. And for those of you not TypeScript inclined, first off, I envy you. Second off, basically all this is doing is just sending an HTTP post request to some mail channels API, right, with the contents of the email that you want to send. Right? And if you stare at this for a while, you're, like, wait a second. There's no authentication here, right? Like, there's no, like, username and passwords or, like, API key in this shit, right? There's nothing. So that's really weird. So I dig a little more. And it turns out the Cloud Flares and Mail Channels partnership entailed Mail Channels creating this API, no auth required. However, the twist is that it's only allow listed at the network level to Cloud Flare ISP space. So you'll only be able to hit the API if you come from a Cloud Flare IP. Well, anybody on the internet can just create a Cloud Flare account for free and hit this API. So, you know, just, like, connecting the dots at, like, 1 a.m. in the morning here, it's, like, okay, so is this, like, I just need to create a Cloud Flare account, which I already did. I just uploaded the worker code, which I already did. And then you could just send emails through Mail Channels for real. And, yeah, that's basically how it works, which is really weird. And then there was this other user in the same community forum after all, like, this. Snarky comments also asking the same issue about work impersonation, which I still don't, like, understand at that point. And the person's, like, hey, so I created, like, a Cloud Flare worker that demonstrates this capability, right? This demonstrates this partnership between Cloud Flare and Mail Channels. And it's just an HTML form where you just put in the contents of the email, right? It's publicly available. I blacked out the URL because I don't want you guys running up this person's Cloud Flare bill. But it's publicly available and you just put in, oh, sorry. It's publicly available. And then you just put in the contents of the email. And then you just put in the contents of the email. And then you just put in the contents of the email. And you just submit. And you send the email, which, okay. And I'm, like, okay, for testing purposes, this is fantastic. And I guess since I'm completely nerd sniped at this point, I'm just going to, like, what's the first three or four test cases that I can think of in order to possibly figure out, like, what these other people are talking about in terms of impersonation? So test case number one, what happens if I just, like, put a domain that doesn't exist in the HTML form of the worker? So I put in as a sender test.waterhogger.com, which is a domain that didn't exist at the time. And I get an error back saying, hey, failed to send email because the domain doesn't exist dummy, which, yeah, makes sense. If this worked, that would be completely foobar, right? And then how about a domain that does exist but I don't control? So as the sender, then I put in test.example.com. And it gives me back null. Yay. I don't know what null means, but it turns out null means it works. So, and I got the email, right? But it goes to spam again, which is normal because I don't control the domain. So I'm like, okay, this seems completely normal. What are these people talking about with impersonation? And I don't know much about email security, but I look up the headers and they're like, yeah, it's fail, soft fail, everything's bad, like, go back, whatever you're doing, stop doing it. But test case three, I'm like, okay, what's the next logical step? What happens out of sheer curiosity if I use a domain that actually uses this thing called mail channels, which I still don't know what the hell it is at this point, right? So I just Google, okay, websites that use mail channels. And at this point, I'm just thinking, you know, I've never heard of this. This must be like some bottom of the barrel email service that maybe like your grandma used in the 1980s or something, right? Nobody, maybe like a thousand people use this, if not less. Nope, nope, nope, nope, nope, nope. So 2 million somewhat domains, at least according to builtwith.com, which is a site that like aggregates technology that a bunch of like websites use and stuff. And this might be a little small there, but there's a some, some, a few heavy hitters in terms of people who use this mail channel service is like boston.gov. There's notepad++.org, which is really funny. There's, and then everything else, though, is more like just random ass websites that host everything and everything. And I really like builtwith.com because, you know, if you were like someone trying to target people, the filter, you know, mail channels, websites with estimated sales revenue over $1 million, just really just preem stuff, right? And I think that's a really good example right there. Turns out I didn't even need to do this because mail channels also has a list of all their customers on the website. Yay. So then I'm like, okay, so then I go back to the worker and I put in like, you know, lobsters at boston.gov, because boston.gov was the one that popped out and, you know, go big or go home. Yeah. And it goes straight to my inbox. No, doesn't pass go, doesn't collect $200, just goes straight into my inbox. And on top of that, if you take a look at the headers, SPF and DMARC both passed. Okay. So I'm like, oh, that's a good thing. So I'm like, okay. And just to be clear at this point, I'm like, like this is a worker publicly available, just on random on the internet that anyone can hit. They could just put in the details of the email and they'll just be able to spoof any of these, those mains. And then I, so I try another, like how about minus at notepad++.org, right? That's, yeah. So, and then I try another, same deal, like goes to my inbox and another and another and another. There's a lot of humorous websites. You can, you can pull from buildwith.com about this. And yeah, they all land in my inbox. So at this point, I'm like, okay, this is obviously a problem, but what the hell is Mail Channels? I've been, I've been using this thing for like at least a few hours now. I still don't know like the who. I know the how, I guess, but not the who. So it turns out, surprise, surprise, Mail Channels is an email transactional service. And, and just to be on the same page, transactional email is like your automated emails. So like these are emails going from robot to human. So like your password resets, your notifications, your emails, new, new newsletters, that kind of stuff. But what was really weird and just like really confusing at the time is that also they're sort of like almost like a cybersecurity company. Well, at least like they're trying to market that, yeah, we're an email transaction service, but we also stop, you know, the bad hackers with the spam and stuff, which is very ironic because, you know, the boston.gov email tends to prove otherwise. But, you know, you find out too that when you start digging into the Mail Channels website, it's its own little microcosm, you know, like it's like a multi-universe of things that you never really thought could be possible. Like you got people putting like RDP credentials in the comment sections of blog posts. You know, like it's its own little universe of things that you never knew could be possible. And, and it turns out, Mail Channels, I was the ignorant one because it turns out Mail Channels is the biggest player in the email transactional space. It's got 42% of the market share and it's got double, more than double the amount of domains. Yeah. Or clients rather than like SendGrid, Mailgun, and all the ones that I knew that I've heard of before. But Mail Channels turns out to be double, more than double the bit like SendGrid, for example. So at this point, like, I'm like, okay, how is this possible? I know some of the basics and just so we're on the same page, like SPF. So sender policy framework. This, what you got to know is that in every email there's like two from fields. There's one in the SMTP, at the SMTP level and the one that the user sees in the actual email. So SPF aka sender policy framework allows you to set a security control on the front field in SMTP. So the one that the user doesn't see. And it basically just allows you to say, hey, these are the IPs and host names that are allowed to send email on behalf of my domain. Okay? So this is what it looks like in practice. It might be a little small, but that's the SPF record of like Boston.gov. And there's a bunch of IPs that basically are saying, hey, these IPs are allowed to send emails on behalf of my domain. But there's also a include statement that includes relay.mailchannels.net, which I'm like, okay, that kind of makes sense because like, you know, they use mail channels, right? And then I try another SPF of another domain that builtwith.com said uses it. Same deal. Always had that include statement with relay.mailchannels.net. Try a few others, same thing. And lo and behold, turns out like that's part of the setup process of using this mail channel service that they tell people to put this include statement in their SPF in order to use their service. But the thing is, if you start thinking about it, right, that also means that all their customers can spoof each other. Because if like they all have the same SPF, that means all of the other domains that have the same SPF record are authorized to send on behalf of each other, right? And couple that with this Cloudflare worker thing, all of a sudden, like it's almost like an open relay situation where like anybody can just go to the Cloudflare worker URL and just put in the emails, the email details that they want to see and bam, you can just spoof their emails. And I'm like, okay, there's no way, like this is a little bit too simple. Like how is this going to work? And it turns out people like back in 2016 were already saying, like doing the same calculations like I was doing. I'm like, hey, so if like website A is using mail channels and website B has the same SPF record, like can't they spoof each other? And again, mail channels in the comments section, they're like, yeah, so wait, gee, the great thing about using us is you just call us and we'll stop the spammer. So and again, like I don't want to misrepresent, I mean, this might be there. I mean, this might be there. I mean, this might be there. I mean, this might be there. This was 2016. So they might have some other stuff. But you know, this is like, this is a fine, this is fine situation, you know, in my head going off here. So I'm like, okay, these guys obviously know about this, because like, people were complaining about it since like 2016. But I'm just gonna email them, they had no official vulnerability reporting channel, I'm just gonna email him saying, hey, I found some stuff, whatever. And I emailed him. And within two minutes, the CEO replies to me, like this guy had this email and speed dial, like it was crazy. I thought And he was like, yeah, so you're probably talking about the SPF issue, right? Yeah, no, we know about that. We don't consider that a vulnerability or an issue whatsoever. And I emailed him about, okay, but you got the Cloudflare worker thing now. Don't you think that requires a little bit of a different kind of thinking, like at least mitigate that? And they're like, no, and radio silence after that. There was no response. And at that point, I'm also questioning myself because it's like, wow, okay, this guy seemed very assertive. Am I the idiot here? Is this just how these services work? But it turns out, no. Other people, other companies like Sangre and Mailgun have a bunch of stuff that solves this situation completely, and especially regarding the SPF headers. So there's sender identity verification, which is basically like what you do with Let's Encrypt certificates to prove domain ownership. You have dedicated sending IPs, which allows you to actually put unique SPF records in your DNS technology. And then you have the API authentication, which allows you to verify your domain and then you have the actual authentication on their API, which ties back the verified domains when you actually try to send an email through the service, right? And this is what, like, if you try to do the same thing with SendGrid, for example, you basically, like, you put in the API key. You have to first verify you own a domain. But if you try to send an email from a domain that you haven't verified you own, it just says, get out of here, bucko. Like, you're not, this is not how this works. Like, stop doing this. You're not allowed to do it. So at this point, I'm like, okay, I need a bigger picture and I don't understand stuff. And I heard, like, through just random research that there's this thing called Project Sonar from Rapid7, and they aggregate internet-wide data regarding, like, HTTP, DNS, and stuff. So I hit them up in order to get access to this database in order to, like, check, like, check all these assumptions of, like, hey, are two million domains actually using this? Like, what's the, like, and other very important information if we want to go forward with this. And so I hit them up. They give me access. And not only do they give me access, they're like, hey, yeah, we're going to help you with this because this is really weird. So shout out to these people over at Rapid7. There were a few that I think don't work there anymore, but they used to work at a time. So shout out to them. And once we start digging through data, it turns out builtwith.com is accurate. And there are around 2,200,000 domains as of January 2023 that usually use mail channels. And at this point, Rapid7 reaches out to them as well as part of the standard vulnerability disclosure process. And they're like, hey. Like, you know, we're working with Marcello now. And the CEO, again, replies in two minutes saying, so we don't consider this SPF thing an issue. But this is the piece of the puzzle that we are missing here. Most of our clients are web hosting providers that don't necessarily own the domains that they send e-mails from. Okay? So it's a feature. So what you have to understand is that apparently there's a niche market out there for, like, web hosting providers to send e-mails on behalf of their clients. And mail channels is, like, sort of like a middleman in order to do that. So it's a feature, not a bug. So it turns out you're probably asking yourself, well, how do they stop this from being, like, Wild West? Well, mail channels has a bunch of, like, compensating controls, at least, you know, according to them, that they do, like, signature checking, math, statistics, trends, IP domain reputation. They also analyze the e-mail responses from people that, like, receive the e-mails. So, like, if that means, I don't know if that means, like, if I just tell someone to fuck off, do they block them? Like, I don't know. In the reply, like, I'm not sure how that works. But they also do, like, OCR stuff. But, okay, fine. I couldn't really tell you how good these compensating controls are because in none of our testing, like, none of the e-mails were blocked. We probably sent, like, a hundred domains between me and Rapid, a hundred e-mails between me and Rapid7, and none of them were blocked. That being said, it was, our e-mails were clearly labeled as test, right? So this was a test. I don't want to misrepresent things. However, I did try to send myself, like, legit phishing e-mails, and they weren't blocked. So I don't know. But then he says something very interesting. He says, domain owners are welcome to secure their domain against impersonation by signing messages with DKIM and setting up an appropriate DMARC policy. So the MailChannels is basically saying, yeah, I mean, we have this SPF issue, but you just set up a DMARC record in DKIM, and you're fine. Nobody can impersonate you. But here's the thing. Remember that Boston.gov e-mail? SPF passed, but also DMARC. DMARC was passing as well. So, like, what the hell is that all about? So DMARC really quickly is a way of putting a security control on the from field that the user does see. So when we're talking about DMARC alignment, we're talking about, hey, does the from field that the user does see match the from field in SMTP, and does it match also any domain sent with any DKIM signature, right? So that's when we talk about DMARC alignment. And in order to, like, test if DMARC does actually stop impersonation from this. We had to grab a bunch of, like, MailChannels customers' domains that had DMARC set up and DKIM set up, right, in order to test that. So it turns out out of the 2 million domains using MailChannels, only 407 actually have any DMARC record whatsoever, right? And out of that, only 105 actually use DKIM. So this whole encouraging customers to do the right thing is definitely, like, it needs a little bit more encouragement, if you ask me. So test case number four, right? So this is, like, the obvious next step. It's like, okay, let's try to spoof an email from a domain that does use MailChannels, right, in their SPF, but also has DMARC and DKIM set up. Gits.com, I don't know what the hell this is, but they are serious about email. They are using MailChannels, but they have DMARC set to strict mode in regards to DKIM alignment and their SPF record. So what this means is basically if the from field doesn't match, right, the one that the user sees in the email, that doesn't match the one in SMTP and doesn't match the one in DKIM signature, it just rejects the email. Like, the end person doesn't even get the email at all. So this is, like, very serious about email stuff. So, you know, gits.com, and it goes straight to inbox. So at this point, we're like, okay, I don't know what's going on here. And it turns out that DMARC and DKIM don't really actually fix this because DMARC passes if SPF or DKIM passes. The or is the important part there. As long as you pass SPF, you're also guaranteed to parse DMARC. Like, that's the gist here. And there's no actual proper way to tell receivers to strictly enforce DKIM, apparently, at least from what we understand. So in summary, you're also guaranteed to pass DMARC by using the CloudFlare worker that uses mail channels. And we verified this really quickly as well through MailTester because if you just send the email through MailTester, which is a service that actually tests the delivery, like, the chances of delivery of your email, right, you can see, hey, DMARC passed, SPF passed, and we get a 9 out of 10. So, like, this is, you know, we're good to go here. There's no problems here. We get docked a point for missing DKIM signature, but, like, it'll still hit the inbox. And at this point, you're probably wondering, but wait, like, what could there possibly else be? And, yeah, I'm here to tell you, yeah, there's more. Hold on. So we, while analyzing the emails, we found a bunch of ARC stuff. And we weren't really sure what this was. We had a bunch of headers before in an email. We, there was, like, ARC seal, ARC message signature, ARC authentication results. And we were, like, wondering, what is this? Like, I've never seen this before. So let me introduce you to authenticated receive chain. Okay, so that's what ARC stands for. And I quote here, ARC allows an intermediate mail server to sign the message's original authentication results so that even when SPF or DKIM fails at the receiver end, the receiver can still check the chain of authentication records to determine whether the message can be, okay, accepted, okay? So what the important thing to know about ARC is that it guarantees chain of custody. It doesn't necessarily mean that the email wasn't spoofed, okay? And ARC was made specifically for email forwarding scenarios because, like, if you want to send a newsletter out, what happens is that the newsletter service sometimes modifies the body of the message and stuff with, like, unsubscribe links. And subject links and that kind of stuff. And so that makes it impossible to use DKIM, for example, in order to actually forward that mail securely. And ARC, it's a relatively experimental protocol. Like, it was written up, I think, in 2016. It was published in 2019. However, that hasn't stopped some few brave souls in adopting it. And by a few brave souls, I mean, like, Gmail, Outlook, Zoho, Fastmail, like, all the big ones. And ProtonMail, new, which I've found out, which you'll see in a second. It's pretty hilarious. So this is what ARC looks like in practice. So when you want to forward an email, right, ARC basically records the authentication results, hence the ARC authentication results header. Each hop the email goes through. So, like, you send it from your email server. It gets sent through multiple other email servers. Each hop puts the AAR header, the AMS header, and the AS header each step of the way in the email in order to record those. And for the sake of this talk, we're only going to talk about the AAR header, because that's where the juice comes in. And, again, like, ARC is meant to determine that the chain of custody hasn't been broken in the email. So, like, the message hasn't been tampered with. It's not really meant to – it's left up to the end receiver to determine if the email was spoofed with the AAR header. So they did. The end receiver has to look at the AAR header, look at the SPF, DKIM, and DMARC results in that header to determine if the email was spoofed or not. So, according to the RFC, this is what an AAR header is supposed to look like. So you got your hop, which is the I property there. And then you got the results of SPF, DKIM, and DMARC. So you can see, like, in the RFC example, they all passed. And the end receiver has to take these results and interpret. And put that in sort of in the calculations of the spam score in order to determine if the email should go to inbox or should go to spam. This is what MailChannel's AAR looks like – header looks like. So, basically, they're not checking SPF, DMARC, or DKIM at all. And what happens is they put in these properties that aren't really necessarily, like, representing what the – like, at least what the header is supposed to do. They put, like, this auth equals pass. What auth? There's no auth. Like, you just do this. Like, you just put the workers public. You don't need auth to do this. So they don't actually check the SPF, DMARC, or DKIM results. And at this point, we're just like, you know, like, please, like, why can't you just be normal? Like, I don't know. Like, this is the weirdest freaking thing we've ever seen. And it always claims auth equals pass in the AAR header. So we were really confused about that. And unfortunately, though… Well, because it's left up to the end receiver to take this information and calculate the spam score with it, it's really impossible to know how, like, putting bad values in this header will influence, like, email delivery. So with Fortinet, for example, they have – well, Fortinet is a good example of anything, to be clear. However, they have documentation out there that states, hey, you can check this checkbox in our product, and we can basically override. All of the SPF, DMARC, and DKIM results with the results of the AAR header, right? So you could potentially – yeah. So it's great. It's fantastic. So – and again, there's no way to actually know how this gets interpreted at the end of the receiver, unfortunately. But what we've found through research is that the presence – the sheer presence of AARC passing in the email headers guarantees a better spam score. And we confirm that. We confirm this with ProtonMail because ProtonMail actually gives you the spam score result – like, it breaks down how it calculated the spam score. With Gmail and Outlook, there really isn't a good way of knowing that. However, in our tests, it seems like it sort of behaves the same way. So AARC passing generally guarantees a better spam score. So if you're, like, conducting phishing engagements, all you have to do is adopt AARC, and you'll have – you know, you'll have a better chance of landing that email in people's inbox. You know, a little Red Team probe tip right there. As a consequence of this, which is very interesting, is that if a domain doesn't have any SPF, DMARC, or DKIM record at all, using mail channels, you can actually potentially spoof them at a higher success rate. So – and then this sort of increases the blast radius a bit, where you can basically spoof emails from domains that aren't set up to send email, and you have a very high chance of actually landing that email in the inbox. So this opens up the blast radius from, like, 2 million domains to, like, over 3 billion, which is very interesting. And again, like, the caveat being that as long as the end service adopted AARC here, you have a higher chance of doing this, which is very interesting. So in order to prove this, I was like, okay, well, first off, I have to find – I have to find a domain without any SPF and DMARC record. And – which is really interesting. It's pretty easy. But there was one in particular that was super interesting to me. And about that time, I – my Black Hat talk about this got accepted. So that was really weird also because, like, I didn't actually submit the Black Hat talk. Yeah. And so it turns out that I spoofed blackhat.com. So that's – so blackhat.com – So blackhat.com didn't have an SPF or DMARC record until February 2023. And because ProtonMail, which is the service I use for my mail, takes AARC into consideration, through the Cloudflare worker that used mail channels, I was able to spoof blackhat.com. Because of their adoption of AARC, ProtonMail calculated that into the spam score, and it just landed straight into the inbox. And these are the headers to prove it. Where you can see, like, ProtonMail is like, okay, blackhat.com doesn't have a DMARC, SPF, or DKIM record, right? So that calculates – that adds zero to the spam score. It's neutral. But, hey, AARC passed. So, hey, that minus one. And apparently that's all that was needed to get that email into the inbox. That little minus one. And, again, like, there's no way of, like, knowing this, like, for sure outside of ProtonMail. Because, like, Gmail and Outlook, from what we've seen, doesn't actually give you the spam score calculations like this. But, yeah, this is very interesting. So, another disclaimer before I do the demo here. Don't do crimes, again. But, yeah, I'm basically now – this is public, where you can go to spamchannel.hacks with three x's, .worker.dev. And you can basically spoof all of mail channels. Domains. And any domain that potentially doesn't have a DMARC SPF record. And this was based off of Isangan's Cloudflare worker code, which is the original person who wrote this. So shout out to him or her. But, yeah, and it only tests on domains you control. The code for this will be available after the talk as well. So quick demo here. One second. Oh. Just thinking about it. Uh-oh. All right. I'm going to try that again. Wow. Wow. Demo gods really hate me. How about this one? Well, there are videos here. Oh. I don't know if we're going to be able to fix that in time. But maybe we will. I don't know. Well, let's see. Well, anyway, I'm going to continue the presentation. Is there – am I allowed to connect to the Internet? Well, at this point, I think I'm not going to get invited to Black Hat. So I think at this point, I'm just going to – I mean, I don't know. All right. Well, if – I don't know. I don't know what's going on. But I'm going to continue. And maybe somebody can come up here and figure that out. Okay. Let's see. Where is the presentation button? There it is. Okay. Perfect. Well, hopefully, I'll be able to show you a video of this. If not, you can literally just try it yourself. You just go to that URL. So disclosure timeline. This all started in November of 2022. I initially contacted MailChannels and told them, hey, you know, this is a thing. You should probably, like, reconsider considering, like, the Cloudflare workers. You did this partnership with Cloudflare now, and you got the Cloudflare worker thing going on. And no further response after that. January 2023, they were contacted by Rapid7. And they were, again, response immediately saying, we don't consider this an issue. But then no further response. Then in June of 2023, I sent the final update to them saying, hey, you know, I got accepted at DEF CON. And I summarized all the findings and everything. Again, no response. And then July of 2023. My MailChannel sends me a random email saying, hey, we noticed that you're speaking at DEF CON. Can you please share your findings with us? To which I said, well, I mean, I've been literally talking to your CEO since November of 2022, but okay. And then so it turns out my vulnerability reporting was going straight to spam. Which is very ironic. I should have used MailChannels for that, apparently. So, yeah. I had like a Gmail filter on that was literally sending my emails to spam for some reason. But after that, they basically said, hey, we introduced this thing called domain lockdown mode. So the takeaway here is as of June 2023, if you're a MailChannels customer, you have this domain lockdown record that they implemented, which basically allows you to specify the worker, the Cloudflare worker that is actually allowed to send emails on behalf of your domain. Or you can completely disallow MailChannels from sending emails. So there's a lot of things that can happen with that. It's not like, when we have a domain lockdown record, you can't send emails from your domain at all. So that's nice. Now, the kicker here, though, is that, like, you can still send emails without the domain lockdown record. So it's not like, you don't need a domain lockdown record in order for people to randomly just send emails from your domain. So you need to actively go in there and put the record, and otherwise people can just spoof your domain. It's to be announced when this will be like a default thing where you're not going to be allowed to send emails. through Cloudflare, through Mailchannels, unless you put in the domain lockdown record. So as of now, you can still spoof all of their customer domains with this. And so if you're an org that uses Mailchannels, you should, well, if you don't know, you should check your SPF record, number one. And if you do use Mailchannels, put in the domain lockdown record. You should probably go through all of your also domains and just make sure that you have an SPF record there set. And if it's a thing, you can also have, like, you can potentially display a banner if an email that doesn't have a DKIM signature comes from a domain that has implemented DKIM. I've never seen that. I don't even know if that's a thing. But that's potentially something you can do. So if you're an email service provider, like Gmail, Outlook, don't just bump the spam score of an email just because ARC is passing. That's, I don't know why, like, why that's a thing. But... But you should probably, like, not do that because I don't think that's how the protocol is intended to work. And if you're an email transaction service, just don't do this. Like, just use centered identity verification and dedicated sending IPs because, like, this solves this entire swath of problems. And everybody uses this except Mailchannels, apparently. And so the final takeaway is email security is very brittle. It relies on, still relies on users and orgs to do the right things. And ARC potentially could incentivize, like, a trend of gaming the system, which is something to consider as well. And then finally, I want to shout out two researchers, Shengkai and Gang, who basically is who I stole all the awesome graphics for DMARC and SPF explanations and stuff. And they did a lot of the initial research into ARC as well. As well as Yisang Gun, who made the initial worker code that I based the tool that I released off of. And a huge shout out to the Rapid7 folks as well. Thank you. Thank you for coming out to help me through this research. Thank you. Perfect. I just want to double check that.