Skip to content

Commit ebab567

Browse files
committed
Added restriction to limit the ID length to 255 characters in bucket lifecycle rules
Signed-off-by: Aayush Chouhan <[email protected]>
1 parent 23f533d commit ebab567

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/endpoint/s3/ops/s3_put_bucket_lifecycle.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,12 @@ async function put_bucket_lifecycle(req) {
8888
};
8989

9090
if (rule.ID?.length === 1) {
91-
current_rule.id = rule.ID[0];
91+
if (rule.ID[0].length > 255) {
92+
dbg.error('Rule should not have ID length exceeding 255 characters', rule);
93+
throw new S3Error(S3Error.InvalidArgument);
94+
} else {
95+
current_rule.id = rule.ID[0];
96+
}
9297
} else {
9398
// Generate a random ID if missing
9499
current_rule.id = uuid();

0 commit comments

Comments
 (0)