Skip to content

Unable to host a static website with S3 at a DNS name registered in Route 53 due to bucket name squattered by spammer

0

A few months ago I registered a DNS name in Route 53. I planned to use it for a project on AWS, but I have not put any contents behind the DNS at the time. Now, I want to set up a S3 bucket to host a static website at the DNS name that I registered. The instructions that I followed said that the S3 bucket must be given the same name as the DNS name. When I tried to create a S3 bucket with that name, S3 said that the "Bucket with the same name already exists". When I pointed my browser to the DNS name I registered, I was served spam contents that I did not set up. It looks like some spammer has created a S3 bucket with that DNS name and highjacked my DNS name to host spam. I was certainly that such a bucket did not exist when I registered the DNS name. How can I stop these spammer from highjacking my DNS name, and removing their S3 bucket?

2 Answers
2

From the comment above about hijacking buckets:

Creating a bucket and creating a DNS record to point to that bucket are two separate things. AWS can't control what buckets customers create. But customers are in control of their own DNS name. So a malicious actor can't create a bucket with a name that you want to use and then point the DNS to it because they are not in control of the DNS record - you are.

While it is slightly more convenient to point DNS directly to the bucket I would strongly encourage you to use CloudFront (as suggested in the accepted answer). That way the bucket name does not matter and you get other benefits such as HTTPS support (very important in the modern world) and other tools such as WAF.

EXPERT

answered 2 years ago

EXPERT

reviewed 2 years ago

0
Accepted Answer

I apologize for the situation you're experiencing. Unfortunately, it appears that someone has indeed created an S3 bucket with the same name as your registered domain name. This is a known issue in the AWS community, where malicious actors create S3 buckets with common or newly registered domain names to exploit them for spam or other nefarious purposes.

To address this issue, you have a few options:

  1. Contact AWS Support: Reach out to AWS Support and explain the situation. They may be able to investigate and potentially remove the offending bucket if it violates AWS policies.

  2. Use a subdomain: Instead of using the exact domain name for your S3 bucket, you could create a bucket with a subdomain, such as "www.yourdomain.com" or "static.yourdomain.com". This would allow you to set up your static website while avoiding the name conflict.

  3. Use a different S3 bucket name: You can create an S3 bucket with a different name and still use it for your static website. When setting up the Route 53 alias record, you'll be able to select this bucket even if its name doesn't match your domain name exactly.

  4. Consider using CloudFront: You can set up an Amazon CloudFront distribution in front of your S3 bucket. This not only provides better performance but also allows you to use any bucket name while still serving content from your desired domain name.

To prevent the spam content from being served through your domain:

  1. Ensure that your Route 53 hosted zone is correctly set up and doesn't have any unexpected records pointing to the spam content.

  2. Create the appropriate A record in Route 53 that points to your legitimate S3 bucket (or CloudFront distribution) once you've set it up.

Remember, while you can't directly remove someone else's S3 bucket, you can control what your domain resolves to through Route 53. By setting up your website correctly and ensuring your DNS records are accurate, you can override any attempt to hijack your domain name.
Sources
I can't route traffic to an Amazon S3 bucket that's configured for website hosting - Amazon Route 53
Tutorial: Configuring a static website using a custom domain registered with Route 53 - Amazon Simple Storage Service
Routing traffic to a website that is hosted in an Amazon S3 bucket - Amazon Route 53

answered 2 years ago

EXPERT

reviewed 2 years ago

  • "This is a known issue in the AWS community, where malicious actors create S3 buckets with common or newly registered domain names to exploit them for spam or other nefarious purposes." Is there any plan at AWS to stop malicious actors from exploiting this vulnerability? It seems to me a serious security issue that by create a S3 bucket, someone can highjack a DNS name that they do not own. Shouldn't there be some safeguard against this, or some way for the owner to reclaim the DNS name?

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.