News for hackers. Stuff that matters.
Re:The AWS S3 Denial of Wallet Amplification Attack by wmf on Wednesday May 01, 2024 @04:07PM (#40228678)
"With range requests, the client can request to retrieve a part of a file, but not the entire file. ... Due to the way AWS calculates egress costs the transfer of the entire file is billed." WTF if true.
Re:The AWS S3 Denial of Wallet Amplification Attack by fabian2k on Wednesday May 01, 2024 @04:11PM (#40228731)
That sounds egregious enough that I have trouble believing this can be correct. My understanding is that AWS bills for egress for every service, parts of the file that aren't transferred are not part of this so can't be billed. There could certainly be S3-specific charges that affect cases like this, no idea. But if AWS bills the full egress traffic costs for a range request I'd consider that essentially fraud.
Re:The AWS S3 Denial of Wallet Amplification Attack by belter on Wednesday May 01, 2024 @04:13PM (#40228748)
Re:The AWS S3 Denial of Wallet Amplification Attack by paulddraper on Wednesday May 01, 2024 @04:18PM (#40228807)
tl;dr

AWS user believes that testing on a 1Gbps connection for 45 min can't be more than $10 of egress.

Gets a $500 bill instead.

Note: This user specified a lower range but not an upper range on the request (and closed the connection prematurely). Essentially read() with an offset, for a ZIP tool.

See also: https://news.ycombinator.com/item?id=40205213

Re:The AWS S3 Denial of Wallet Amplification Attack by fabian2k on Wednesday May 01, 2024 @04:28PM (#40228935)
There is probably a small area where it's difficult to measure, so I would not expect billing to be exact to the byte here. But billing for the requested range if not the entire range was actually transferred is just not correct and not acceptable.
Re:The AWS S3 Denial of Wallet Amplification Attack by paulddraper on Wednesday May 01, 2024 @05:15PM (#40229537)
Certainly if you are charging for internet egress.

Like, charging for requests or internal data processing, sure okay.

But this is a charge specifically for the data transferred from AWS to the internet. So if you're not transferring data to the internet....

Re:The AWS S3 Denial of Wallet Amplification Attack by fabian2k on Wednesday May 01, 2024 @05:19PM (#40229608)
The part where I think there is some flexibility is about the difference between "bytes attempted to transfer" and "bytes actually transferred". I think it is pretty fair to bill for the former, as long as you abort requests in a reasonable way. So I don't expect it to be billed exactly by the transferred byte, but I do expect it to not go above that higher than whatever the chunk size for transferring is.
Re:The AWS S3 Denial of Wallet Amplification Attack by klabb3 on Wednesday May 01, 2024 @06:25PM (#40230362)
That’s an orthogonal issue. There’s no interpretation of “egress” that means “stuff we do internally before leaving aws data centers”. If the tcp conn is reset only a few MB would leave aws frontend servers. Instead, it appears they’ve been basing the number off the range in the request and/or whatever internal caching/loading they’re doing within S3, which again has nothing to do with egress.

I mean, we already know egress is short for egregious. It’s an incredibly bad look to be overestimating the “fuck you” part of the bill.

Re:The AWS S3 Denial of Wallet Amplification Attack by paulddraper on Wednesday May 01, 2024 @06:17PM (#40230283)
Sure. In this case specifically AWS is attempting to transfer 70Gbps through a 1Gbps pipe. Not a rounding error.
Re:The AWS S3 Denial of Wallet Amplification Attack by yonixwm on Wednesday May 01, 2024 @04:25PM (#40228889)
So I guess the attack of the OP is a case AWS calculate price based on the unbounded request header and not on the actual egress
Re:The AWS S3 Denial of Wallet Amplification Attack by scottlamb on Wednesday May 01, 2024 @04:35PM (#40229030)
More or less. The article quotes AWS as saying the following:

> Amazon S3 attempts to stop the streaming of data, but it does not happen instantaneously.

...which doesn't really explain it. It shouldn't send more than a TCP window after the connection is closed, and TCP windows are at most 1 GiB [1], usually much less, so this completely fails to explain the article's observed 3 TB sent vs 130 TB billed.

The article goes on to say:

> Okay, this is half the explanation. AWS customers are not billed for the data actually transferred to the Internet but instead for some amount of data that is cached internally.

In other words, how much they bill really isn't bounded by how much is sent at all. This is unacceptable.

[1] https://en.wikipedia.org/wiki/TCP_window_scale_option

Re:The AWS S3 Denial of Wallet Amplification Attack by easton on Wednesday May 01, 2024 @04:49PM (#40229223)
> this completely fails to explain the article's observed 3 TB sent vs 130 TB billed

I interpreted that to be that their code was doing this over and over again, so in total they retrieved 3TB over a set of requests. Still horrifying, but mildly more explainable.

Re:The AWS S3 Denial of Wallet Amplification Attack by scottlamb on Wednesday May 01, 2024 @09:54PM (#40231940)
Even so, TCP windows generally don't start at the maximum size, so I'm really not buying that ratio of bytes ACKed to sent.

One could disprove this explanation with a packet capture; just add the remaining window.

Re:The AWS S3 Denial of Wallet Amplification Attack by slt2021 on Wednesday May 01, 2024 @05:53PM (#40229995)
this can be explained that this may be not egress out of AWS, but egress out of S3 system itself.

S3 is a block storage, so retrieving an object for such a high availability and high perf service means it tries to pull some X block of data and cache it before sending through the socket.

That X block of data is out of internal S3 storage, just not sent through the bigger Internet egress subsystem.

So technically aws may argue this is egress for s3, just not for aws

Re:The AWS S3 Denial of Wallet Amplification Attack by jpambrun on Wednesday May 01, 2024 @08:04PM (#40231189)
The consequence of your interpretation is that surprise billing is not even bounded by the physical limitations. This is absolutely not reasonable. I am the user with in the zip case. I knew this testing would incur a cost, but I could imagine it could be 20x my network speed and I have absolutely no control over what AWS claims to meter.
Re:The AWS S3 Denial of Wallet Amplification Attack by vermilingua on Wednesday May 01, 2024 @05:58PM (#40230048)
Then subsequent requests that hit the cache shouldn’t be charged by that logic.
Re:The AWS S3 Denial of Wallet Amplification Attack by slt2021 on Wednesday May 01, 2024 @06:04PM (#40230114)
s3 is a complex system, you could be hitting a different node with subsequent requests where this cache entry does not exist yet.

if you think egress is expensive, well storing data in RAM for cache purposes is 1000000x more expensive

a lot of stuff could be happening. Main problem is AWS (i think) is charging for egress out of S3 system, but customers are looking at their ingress at client side and there is mismatch

Re:The AWS S3 Denial of Wallet Amplification Attack by jpambrun on Wednesday May 01, 2024 @08:07PM (#40231208)
But you are not charged if it's not Internet egress, which makes your argument about compute/ram cost moot.
Re:The AWS S3 Denial of Wallet Amplification Attack by yencabulator on Thursday May 02, 2024 @04:18PM (#40240942)
If they charged for the extents that are actually read from S3 (even if the network connection was just closed), that'd be fine. But charging for terabytes when the actual connection consumed a few kilobytes is still wrong; surely they didn't e.g. buffer those terabytes of data from S3 disk storage into memory.

Charge for the buffer you fill: sure.

Charge the theoretical maximum: silly.

Re:The AWS S3 Denial of Wallet Amplification Attack by paulddraper on Wednesday May 01, 2024 @06:20PM (#40230311)
> AWS customers are not billed for the data actually transferred to the Internet but instead for some amount of data that is cached internally.

But egress fees only apply to S3 transfers outside AWS?

So which is it? Data transferred to the Internet? Or data processed internally?

Re:The AWS S3 Denial of Wallet Amplification Attack by scottlamb on Wednesday May 01, 2024 @09:56PM (#40231954)
Obviously they break the problem down into questions like "what's the maximum that could be transferred between any two components? what's the most expensive components this transits?" and pick the most expensive answers without any attempt at coherence.

Right now some class action lawyer is drooling.

Re:The AWS S3 Denial of Wallet Amplification Attack by __roland__ on Wednesday May 01, 2024 @05:06PM (#40229427)
Sorry, I think that part of our write-up is misleading (I was involved in analyzing the issue described here). To our best understanding, what happens is the following:

- A client sends range requests and cancels them quickly.

- The full range request data will be billed (NOT the whole file), so I think this should read that the entire requested range gets billed, even if it never gets transferred (the explanation we received for this is that it's due to some internal buffering S3 is doing, and they do count this as egress).

In any case, if you send and cancel such requests quickly (which is easy enough, this was not even an adversarial situation, just a bug in some client API code) the egress cost is many times higher than your theoretical bandwidth (and about 80x higher than in the AWS documentation, hence the blogpost).

Re:The AWS S3 Denial of Wallet Amplification Attack by nijave on Wednesday May 01, 2024 @05:11PM (#40229474)
This is a problem with lots of services. Blocking large quantities of legitimate looking requests is a hard problem. Request cancellation is also tricky and not supported well in a lot of frameworks/programming languages.
Re:The AWS S3 Denial of Wallet Amplification Attack by thayne on Wednesday May 01, 2024 @09:29PM (#40231781)
But the thing you are supposedly getting billed for is data transferred to the Internet. If the connection is closed there might be some data that goes out before the reset is received, but not that much. So either this is a bug, or the pricing documention is ... incorrect about what they actually charge you for.
Re:The AWS S3 Denial of Wallet Amplification Attack by martin-lim on Thursday May 02, 2024 @02:30AM (#40233289)
Sadly this is no bug. Customers are NOT billed for actual data transferred. Customers are billed for "some kind of" data requested. If you interrupt the data transfer before downloading all requested data then it's "your fault". AWS documents this detail somewhere hidden on the S3 pricing page (https://aws.amazon.com/s3/pricing/). Search for "Data Transfer Out may be different from the data received" in the "Data transfer" tab.
Re:The AWS S3 Denial of Wallet Amplification Attack by thayne on Thursday May 02, 2024 @03:43AM (#40233706)
That explanation still makes it sound like you are charged for what is transferred to the Internet, but your application might not get some of it because it already closed the connection.

From the OP it sounds like the amount billed is too high to be explained by that.

If what you are billed for isn't actually data transferred, then it is deceptive to say that you are billed for "data transferred out".

Re:The AWS S3 Denial of Wallet Amplification Attack by jpambrun on Thursday May 02, 2024 @07:33AM (#40234942)
It like if the gaz compagny billed you for more gaz your pipe can physically take. No amount of fine print can change physics. If they bill for some opaque internal metric they need to change the wording to reflect this on all documentation: "we will bill you for whatever we please, you can't audit and we won't explain how it works".
Re:The AWS S3 Denial of Wallet Amplification Attack by thayne on Wednesday May 01, 2024 @09:26PM (#40231760)
Wait. What if the range is bigger than the file? Say if I made a request for a 5 TB range but the file is actually only 1kb. Would you get charged for 5 TB of egress?
Re:The AWS S3 Denial of Wallet Amplification Attack by andersa on Thursday May 02, 2024 @01:55PM (#40239247)
This will return a range error instead of serving the file.
Re:The AWS S3 Denial of Wallet Amplification Attack by nicklecompte on Wednesday May 01, 2024 @04:42PM (#40229136)
This must be a regression bug in AWS's internal system. At a past job (2020) we used S3 to store a large amount of genomic data, and a web application read range requests to visualize tiny segments of the genetic sequence in relevant genes - like 5kb out of 50GB. If AWS had billed the cost of an entire genome/exome every time we did that, we would have noticed. I monitored costs pretty closely, S3 was never a problem compared to EC2.

It also seemed like the root cause was an interrupted range request (although I wasn't fully clear on that). Even so that seems like a recent regression. It took me ages to get that stupid app working, I interrupted a lot of range requests :)

Re:The AWS S3 Denial of Wallet Amplification Attack by __roland__ on Wednesday May 01, 2024 @05:09PM (#40229457)
You are right, this is about canceling range requests and still getting billed, not about requesting ranges and getting billed for the complete file egress. Sorry; we'll make the post clearer.
Re:The AWS S3 Denial of Wallet Amplification Attack by nextaccountic on Wednesday May 01, 2024 @08:24PM (#40231323)
This seems like something that customers can potentially sue for. AWS is overcharging them and not correcting the bug once they become aware of it.
Re:The AWS S3 Denial of Wallet Amplification Attack by nielsole on Wednesday May 01, 2024 @05:08PM (#40229446)
S3 egress costs are free if the traffic stays within AWS. Sounds like your clients were EC2 instances so this wouldn't apply to you, would it?
Re:The AWS S3 Denial of Wallet Amplification Attack by mikepurvis on Wednesday May 01, 2024 @05:17PM (#40229558)
If it was a web application as stated in the GP, then it would indeed be egress as the request would be coming from a browser.
Re:The AWS S3 Denial of Wallet Amplification Attack by nicklecompte on Wednesday May 01, 2024 @05:24PM (#40229666)
Yes, it was client-side JavaScript making the range requests, asking for a string of genomic data to render in the browser. It was only to give the scientists a pretty picture :) The EC2 costs were largely ElasticSearch for a different function, which never looked at the data in S3.
Re:The AWS S3 Denial of Wallet Amplification Attack by belter on Thursday May 02, 2024 @04:14AM (#40233855)
> S3 egress costs are free if the traffic stays within AWS

Not if it's cross-region.