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

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

Aperta
#200 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub
enhancement
Lingua principale
Java
Stelle
34
Fork
21
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

### 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.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Reproduce the range request through S3EncryptionClient.getObject using a 64KB object and bytes=65536-65635, then compare it with the regular S3Client behavior described in the issue. Trace how the encryption client handles the range response; done means the encrypted client reports a 416 range-not-satisfiable error for a range beyond EOF.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
aws, java
Ambito
backend, security
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.