aws / aws/amazon-s3-encryption-client-java

S3 Encryption client does throw an error for ranges greater than EOF

未关闭
#200 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
enhancement
主要语言
Java
星标
34
派生
21
PR 合并指标
30 天内没有已合并 PR

描述

### Problem:

I created a 64KB (65536 bytes) with S3Encryption client, and then did

```
S3Client s3Client = S3Client.builder().region(Region.EU_WEST_1).build();

S3Client s3ECClient = S3EncryptionClient.builder()
.kmsKeyId("xxx")
.wrappedClient(s3Client)
.wrappedAsyncClient(S3AsyncClient.builder().region(Region.EU_WEST_1).build())
.enableLegacyUnauthenticatedModes(true)
.build();

ResponseInputStream inputStream = s3ECClient.getObject(GetObjectRequest.builder()
.bucket("xxxx")
.key("xxxx")
.range("bytes=65536-65635").build());
```
So end of range `65635` is greater than EOF at `65536`. And no error was thrown.

Creating a file with a regular S3 client and then doing

```
ResponseInputStream inputStream = s3Client.getObject(GetObjectRequest.builder()
.bucket("xxx")
.key("xxxx")
.range("bytes=65536-65635").build());
```

throws `software.amazon.awssdk.services.s3.model.S3Exception: The requested range is not satisfiable (Service: S3, Status Code: 416, Request ID:` which is what we expect to be thrown in S3A.

### Solution:

S3 Encryption client should also throw a 416 range not satisfiable error.

贡献指南

打开贡献指南

调研方向

使用 64KB 对象和 bytes=65536-65635,通过 S3EncryptionClient.getObject 重现范围请求,然后将其与 issue 中描述的常规 S3Client 行为进行比较。跟踪加密客户端如何处理范围响应;完成的标准是,对于超出 EOF 的范围,加密客户端报告 416 范围不可满足错误。

由索引模型根据 Issue 内容生成。

评估

技术栈
aws, java
领域
backend, security
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。