logoalt Hacker News

Bucketsquatting is (finally) dead

272 pointsby boytertoday at 8:31 AM141 commentsview on HN

Comments

etothettoday at 11:56 AM

Speaking of unique names within AWS, I learned the other day that even after you delete an AWS account, you can’t reuse the root user email addresses (it’s documented, but I wasn’t aware).

Someone at my org used their main company email address for a root user om an account we just closed and a 2nd company email for our current account. We are past the time period where AWS allows for reverting the account deletion.

This now means that he isn’t allowed to use SSO via our external IdP because the email address he would use is forever attached to the deleted AWS account root user!

AWS support was rather terrible in providing help.

show 8 replies
vhabtoday at 9:22 AM

> For Azure Blob Storage, storage accounts are scoped with an account name and container name, so this is far less of a concern.

The author probably misunderstood what "account name" is in Azure Storage's context, as it's pretty much the equivalent of S3's bucket name, and is definitely still a large concern.

A single pool of unique names for storage accounts across all customers has been a very large source of frustration, especially with the really short name limit of only 24 characters.

I hope Microsoft follows suit and introduces a unique namespace per customer as well.

show 2 replies
josephgtoday at 10:20 AM

Sometimes I wonder if package names, bucket names, github account names and so on should use a naming scheme like discord. Eg, @sometag-xxxx where xxxx is a random 4 digit code. Its sort of a middleground between UUID account names and completely human generated names.

This approach goes a long way toward democratizing the name space, since nobody can "own" the tag prefix. (10000 people can all share it). This can also be used to prevent squatting and reuse attacks - just burn the full account name if the corresponding user account is ever shut down. And it prevents early users from being able to snap up all the good names.

show 5 replies
iknownothowtoday at 10:00 AM

Thank you author Ian Mckay! This is one of those good hygiene conventions that save time by not having to think/worry each time buckets are named. As pointed out in the article, AWS seems to have made this part of their official naming conventions [1].

I'm excited for IaC code libraries like Terraform to incorporate this as their default behavior soon! The default behavior of Terraform and co is already to add a random hash suffix to the end of the bucket name to prevent such errors. This becoming standard practice in itself has saved me days in not having to convince others to use such strategies prior to automation.

[1] https://aws.amazon.com/blogs/aws/introducing-account-regiona...

SoftTalkertoday at 3:59 PM

DNS names have the same problem.

Once they are not renewed, they eventually become available again. Then anyone can re-register them, set up an MX record, and start receiving any emails still being sent to recipients in that domain. This could include password reset authentications for other services, etc.

ian_dtoday at 12:27 PM

The _really_ fun bucket squatting attacks are when the cloud providers themselves use deterministic names for "scratch space" buckets. There was a good DC talk about it at DC32 for AWS, although actual squatting was tough because there was a hash they researchers couldn't reverse (but was consistent for a given account?): https://www.youtube.com/watch?v=m9QVfYVJ7R8

GCP, however, has does this to itself multiple times because they rely so heavily on project-id, most recently just this February: https://www.sentinelone.com/vulnerability-database/cve-2026-...

sauriktoday at 2:16 PM

AWS buckets still offer special features if and only if the name of the bucket matches your hostname.

https://docs.aws.amazon.com/AmazonS3/latest/userguide/Virtua...

PunchyHamstertoday at 1:10 PM

decision to make bucket (and not bucket + account id surrogate) a sole key for access was one of most annoying mistakes in S3 design

bulbartoday at 11:28 AM

A name shouldn't be the same as the thing it names.

When a name becomes free and somebody else uses it, it points to another thing. What that means for consumers of the name depends on the context, most likely it means not to use it. If you yourself reassign the name you can decide that the new thing will be considered to be identical to the old thing.

arjietoday at 4:41 PM

Good solution. Thanks for popularizing it.

* Backwards compatible

* Keeps readability

* Solves problem

alemwjsltoday at 10:05 AM

I take it advertising your account id isn't a security risk?

show 1 reply
Bridged7756today at 2:40 PM

I think I'm not getting it. What's the problem if someone else can claim that bucket name? If it's deleted wouldn't the data be deleted too? Or is it there something I'm missing.

show 2 replies
CafeRacertoday at 12:58 PM

While I understand where it's coming from I always had something like <bucket_tag>-<9_random_\d\w>

calmwormtoday at 9:17 AM

That took a decade to resolve? Surprising, but hindsight is 20/20 I guess.

thih9today at 9:21 AM

> If you wish to protect your existing buckets, you’ll need to create new buckets with the namespace pattern and migrate your data to those buckets.

My pet conspiracy theory: this article was written by bucket squatters who want to claim old bucket names after AI agents read this and blindly follow.

peanut-walrustoday at 2:29 PM

Why the hell is this a name suffix instead of just using subdomains?

myapp-123456789012-us-west-2-an

vs myapp.123456789012.us-west-2.s3.amazonaws.com

The manipulations I will need to do to fit into the 63 char limit will be atrocious.

show 1 reply
INTPenistoday at 9:28 AM

I started treating long random bucketnames as secrets years ago. Ever since I noticed hackers were discovering buckets online with secrets and healthcare info.

This is where IaC shines.

show 2 replies
ClaudeFixertoday at 11:27 AM

Good riddance. The number of production deploys I've seen pointing at bucket names that could've been claimed by anyone was wild. Glad this is finally getting closed off at the platform level instead of relying on everyone to not make the mistake.

amnetoday at 1:28 PM

I hope nobody wanted "ecommerce-admin". sorry

Aardwolftoday at 9:22 AM

Why all that stuff with namespaces when they could just not allow name reuse?

show 4 replies
pooplord69today at 3:00 PM

Does it still take like an hour to rename one?

lsaferitetoday at 12:27 PM

I mean, why isn't this just the mandatory default going forward? Globally shared, unique bucket names always struck me as a horrible idea.

GuinansEyebrowstoday at 3:04 PM

this seems nice but it's a little annoying if you've been using terraform's `bucket_prefix` to create buckets. i wonder if/when they'll update that or if they'll add a new bucket_name argument that uses the new namespacing.

sriramgonellatoday at 9:34 AM

[dead]

shablulmantoday at 9:21 AM

[dead]

perunamiestoday at 12:19 PM

[flagged]

ChrisMarshallNYtoday at 9:11 AM

[flagged]

show 2 replies
useftmlytoday at 2:53 PM

[flagged]

lijoktoday at 9:09 AM

Huh? Hash your bucket names

show 2 replies