From 84a421857b29f214bf0d83d15333dc7e5f699a34 Mon Sep 17 00:00:00 2001 From: Aayush Chouhan Date: Tue, 7 Jan 2025 20:07:54 +0530 Subject: [PATCH] Added a fix for not valid status value in lifecycle configuration Signed-off-by: Aayush Chouhan --- src/endpoint/s3/ops/s3_put_bucket_lifecycle.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/endpoint/s3/ops/s3_put_bucket_lifecycle.js b/src/endpoint/s3/ops/s3_put_bucket_lifecycle.js index b54024cc4f..66fc433d8e 100644 --- a/src/endpoint/s3/ops/s3_put_bucket_lifecycle.js +++ b/src/endpoint/s3/ops/s3_put_bucket_lifecycle.js @@ -97,6 +97,11 @@ async function put_bucket_lifecycle(req) { if (rule.Status?.length !== 1) { dbg.error('Rule should have status', rule); throw new S3Error(S3Error.InvalidArgument); + } else if (rule.status?.length == 1) { + if (rule.Status[0] !== "Enabled" || rule.Status[0] !== "Disabled") { + dbg.error('Rule should not have status value: ', rule.Status[0]); + throw new S3Error({ ...S3Error.MalformedXML, message: 'The XML you provided was not well-formed or did not validate against our published schema'}); + } } current_rule.status = rule.Status[0];