News for hackers. Stuff that matters.
Re:MarkMonitor left 60k domains for the taking by tyingq on Sunday August 29, 2021 @07:57PM (#28351613)
What do they require? You can just claim any S3 bucket you want that's been 'abandoned'?
Re:MarkMonitor left 60k domains for the taking by pyentropy on Sunday August 29, 2021 @08:11PM (#28351686)
No, S3 buckets named after hostnames are served when said hostname is pointing to S3 servers .

Bob owns bob.com and sets CNAME bob.com.us-east-1.amazonaws.com. Eve creates the bucket and can now serve any static content she wants.

Re:MarkMonitor left 60k domains for the taking by bawolff on Sunday August 29, 2021 @08:48PM (#28351862)
That seems pretty reasonable to me. How should AWS verify domain ownership if not control over the CNAME?
Re:MarkMonitor left 60k domains for the taking by moltar on Sunday August 29, 2021 @09:24PM (#28352031)
Google provides several options for site verification. They provide a string you must place on your website using one of the following ways:

- DNS TXT record

- HTML meta tag

- Upload a file with a randomized name to your site root

Re:MarkMonitor left 60k domains for the taking by ctvo on Sunday August 29, 2021 @09:53PM (#28352155)
This is the reverse situation. What's going on here:

- Bob makes bob.com and sets the CNAME to be bobstaticsite.s3.aws

- Bob forgot to make a bucket called bobstaticsite.s3, and Alice, scanning the DNS records, creates it instead. Now Alice is serving data on Bob's domain

Am I missing something? How would AWS S3 stop you from creating a CNAME? Or how is this their responsibility? Don't make that CNAME entry pointing to a bucket you didn't create yet / don't own?

One final thing: S3 is not CloudFront. And CloudFront, AWS's CDN, does require domain name verification.

Re:MarkMonitor left 60k domains for the taking by elithrar on Sunday August 29, 2021 @10:25PM (#28352291)
> Am I missing something? How would AWS S3 stop you from creating a CNAME? Or how is this their responsibility?

They (AWS) should not accept traffic on that hostname until ownership - tightly bound - is proven.

This also helps avoid related cases, such as deleting a bucket (which now frees it up) - other services like Heroku have similarly been vulnerable to this takeover hack because of a lack of strict verification: https://0xpatrik.com/subdomain-takeover-providers/

Every new bucket, service or account handling traffic for a domain should require re-verification. That verification should never persist beyond the lifetime of that resource.

Re:MarkMonitor left 60k domains for the taking by elcomet on Monday August 30, 2021 @05:21AM (#28353992)
> They (AWS) should not accept traffic on that hostname until ownership - tightly bound - is proven.

Why shouldn't they ? Don't you think it can be a useful feature ?

Re:MarkMonitor left 60k domains for the taking by FlyingAvatar on Monday August 30, 2021 @09:56AM (#28355692)
The problem is that AWS only allows hosting domains on S3 that match the hostname. i.e. If I want to host some content from S3 on 'static.mydomain.com', I MUST own the bucket of the same name.

If someone else creates the bucket on their AWS account, I am stuck. I would have to use a different hostname, or use a more complex workaround. Since creating empty buckets costs nothing, it effectively allows DoSing hostnames from an S3 hosting standpoint.

It would be one thing to allow this behavior if a domain owner explicitly wanted it, via a TXT record or something, but as it is, it's a poorly designed solution.

Re:MarkMonitor left 60k domains for the taking by detaro on Sunday August 29, 2021 @10:21PM (#28352274)
AWS can't stop you from creating the CNAME, but AWS could stop Alice from creating the bucket, or (IMHO better) not serve HTTP(S) traffic for bob.com from that bucket unless it is confirmed that the bucket belongs to the owner of bob.com.
Re:MarkMonitor left 60k domains for the taking by mhio on Sunday August 29, 2021 @11:34PM (#28352581)
Amazon can't "know" out of all domains if one has a CNAME pointing to a bucket name though. Even if they did, that would be open to abuse by anyone.
Re:MarkMonitor left 60k domains for the taking by detaro on Sunday August 29, 2021 @11:39PM (#28352606)
derp, true. so only the second method works.
Re:MarkMonitor left 60k domains for the taking by chaboud on Sunday August 29, 2021 @11:07PM (#28352471)
Could Eve then just register bob.com and point it to bob's random bucket to mess with him?

And shouldn't Alice be able to register Alice.com and point it at Bob's bucket if she feels like it?

It seems like the answer already exists: don't create CNAMEs haphazardly.

(But please explain it to me if I'm missing something here)

Re:MarkMonitor left 60k domains for the taking by detaro on Sunday August 29, 2021 @11:14PM (#28352503)
> Could Eve then just register bob.com and point it to bob's random bucket to mess with him?

If it blocks creation, she would have to know the bucket name Bob would want to create soon. At which point she could just create the bucket instead.

> And shouldn't Alice be able to register Alice.com and point it at Bob's bucket if she feels like it?

She can only do that with this method if Bob's bucket is called "alice.com". Doesn't seem important to support for random unrelated people, if its for a dedicated setup where Bob manages a thing for Alice you could always have a way of granting that permission specifically or to opt out of the verification.

> It seems like the answer already exists: don't create CNAMEs haphazardly.

"don't make mistakes". If people keep making a mistake all the time, that's not the greatest answer. There's a reason most other providers that allow you to point a domain at them do some verification.

Re:MarkMonitor left 60k domains for the taking by chaboud on Monday August 30, 2021 @12:35AM (#28352844)
How would it block creation? Is AWS supposed to keep a full record of CNAME entries for the Internet and keep it up to date?

Since CNAME records can point to other domains, I’m not sure how AWS is supposed to police this and allow cross-referencing from other parties. Blocking based on any CNAME presence could turn into a bucket-squatting exploit pretty quickly.

A CNAME record is an “I’m pointing my domain at some other place” record. Redirect to something out of your control, S3 or otherwise, and you’re handing over control of the returned content. That doesn’t so much strike me as a mistake but more as the way that CNAME records were designed to work.

Re:MarkMonitor left 60k domains for the taking by detaro on Monday August 30, 2021 @12:41AM (#28352860)
yes, as mhio already pointed out the first variant doesn't actually work. The second does though, and is what's commonly done.

> That doesn’t so much strike me as a mistake but more as the way that CNAME records were designed to work.

"I hold something into a saw, and it gets cut. That doesn’t so much strike me as a mistake but more as the way that saws are supposed to work. Why are all these fingerless people saying our saws should have safety features?!"

We know such things happen to all kinds of people all the time. It has been part of actual security problems. We know how to fix it, because many service providers do require validation. Why not consider the validation?

Re:MarkMonitor left 60k domains for the taking by chaboud on Tuesday August 31, 2021 @10:35AM (#28368655)
You’ve tried the snark twice, but it’s not aiding your point.

What is the actual mechanism you think should be implemented, and how does that support cross-party referencing while avoiding other modes of vulnerability (e.g. denial of service)?

Re:MarkMonitor left 60k domains for the taking by bawolff on Sunday August 29, 2021 @11:30PM (#28352565)
All of which are much weaker than the CNAME, since with a cname you can do all 3.
Re:MarkMonitor left 60k domains for the taking by detaro on Sunday August 29, 2021 @08:56PM (#28351890)
it doesn't verify control over the CNAME from the person creating the bucket, that's the criticism, instead it lets any AWS user claim it. (The usual verification method would be something like requiring a TXT record to be set with a secret that's tied to the bucket, and I guess for route53 users they could integrate settings from there)
Re:MarkMonitor left 60k domains for the taking by fastball on Sunday August 29, 2021 @10:40PM (#28352353)
Right, but the owner of the domain needs to create a CNAME record that points to AWS for a bucket they don't control. How is that not purely on them?
Re:MarkMonitor left 60k domains for the taking by detaro on Sunday August 29, 2021 @10:59PM (#28352435)
If thousands of people keep making a mistake when using your product, you can go "purely on them, not our problem", true. Or you can do something to your product to make the mistake less likely to cause a problem.
Re:MarkMonitor left 60k domains for the taking by Sebb767 on Monday August 30, 2021 @01:30AM (#28353025)
The bucket can be created before they can do so, which is exactly what happened to MarkMonitor here. Now, technically you could create the bucket first before setting the CNAME, but this can quickly go wrong (especially when handling hundreds of domains) and it regularly does. There's no need to keep this footgun around.
Re:MarkMonitor left 60k domains for the taking by ctvo on Monday August 30, 2021 @08:36AM (#28354984)
S3 is not a CDN. S3 is a distributed file system. Use a CDN for CDN use cases (CloudFront) and you wouldn't have these issues.

There's a chance a normal AWS user may not understand the above distinction, a sophisticated actor like MarkMonitor (whose business is THIS) should. Instead they had a security incident. That's it. They used the wrong AWS service. They configured massive numbers of domain DNS records incorrectly. They risked their customer's reputations.

Re:MarkMonitor left 60k domains for the taking by tialaramex on Sunday August 29, 2021 @10:14PM (#28352247)
If they cared, a reasonable choice would be to lean on the Web PKI. It is usual in the Web PKI for the leaf certificates to be certified both to identify a server (which is what is ordinarily done) and to identify a client. The only name usually provided for the subject is a DNS name, but in this case that's exactly the identity we want to prove.

That is, you'd prove you control www.example.com to AWS the exact same way www.example.com proves it is www.example.com to a web browser.

Re:MarkMonitor left 60k domains for the taking by bawolff on Sunday August 29, 2021 @11:14PM (#28352502)
If you control the cname its trivial to get a cert.
Re:MarkMonitor left 60k domains for the taking by tialaramex on Monday August 30, 2021 @04:10AM (#28353638)
Sure, but the point of this choice is to make it easy for a third party to verify your identity, the exact same problem as for web browsers visiting an HTTPS site.
Re:MarkMonitor left 60k domains for the taking by huibf on Sunday August 29, 2021 @08:33PM (#28351798)
Maybe Bob shouldn't have set cname bob.com.us-east-1.amazonaws.com if he didn't own the bucket?!
Re:MarkMonitor left 60k domains for the taking by fragmede on Monday August 30, 2021 @02:24AM (#28353225)
That's easy to say when there's single or double digit number of people involved, but three or four (or five!)?
Re:MarkMonitor left 60k domains for the taking by bombcar on Sunday August 29, 2021 @10:39PM (#28352347)
Often they did have it but it was decommissioned or deleted.
Re:MarkMonitor left 60k domains for the taking by zerocrates on Sunday August 29, 2021 @09:00PM (#28351904)
What's the method of attack here? Bob at some point stops using the site and deletes the bucket but not the DNS entry, and you notice that and create a new bucket with that now-available name?
Re:MarkMonitor left 60k domains for the taking by detaro on Sunday August 29, 2021 @09:14PM (#28351986)
Or as happened here, bob points the site to S3 because he plans to put something there later, and Eve beats him to it.
Re:MarkMonitor left 60k domains for the taking by vmception on Sunday August 29, 2021 @09:11PM (#28351969)
No

This company never created the S3 buckets at all but set them in the CNAME, for domains that were purchased but never used

They can change the CNAME at any time, it’s a pretty dumb but inconsequential exploit. Potentially some purchaser didn’t use generally free and default whois privacy and could be associated with offbrand content.

Potentially someone observant can earn a bunch of ad dollars on a popular domain.

Re:MarkMonitor left 60k domains for the taking by yellow_lead on Sunday August 29, 2021 @09:41PM (#28352099)
I don't think it's as inconsequential as you say. Coinbase.ca and google.ar were two of these domains. The author noted that TLS certs could have been minted and then used in MITM attacks, if, for example, Coinbase began operating in Canada.