← Java / Spring · Contents

JAVA-087 / Intermediate

Public object settings in storage such as S3 (Spring Cloud AWS)

A01:2021 · CWE-200 Exposure of Sensitive Information

Why is this a problem?

Sensitive files become URLs accessible to anyone.

How to fix it

java
s3Presigner.presignGetObject(b -> b.signatureDuration(Duration.ofMinutes(5))
    .getObjectRequest(r -> r.bucket(B).key(k)));   // Presigned URL

Further reading