Skip to content

HDDS-16393. Reject oversized Days values in PutBucketLifecycle - #11290

Open
priyeshkaratha wants to merge 1 commit into
apache:masterfrom
priyeshkaratha:HDDS-16393
Open

priyeshkaratha wants to merge 1 commit into
apache:masterfrom
priyeshkaratha:HDDS-16393

Conversation

@priyeshkaratha

Copy link
Copy Markdown
Member

What changes were proposed in this pull request?

PutBucketLifecycleConfiguration accepted a Days value that overflows a 32-bit int (e.g. 3323232323232323232323232323232323232323232) and returned HTTP 200. JAXB's built-in Integer converter silently wrapped the value, so a subsequent GetBucketLifecycleConfiguration returned a different, unrelated value (347068064) than what was submitted which is risking unexpected object expiration behavior.

Bind Expiration.Days and AbortIncompleteMultipartUpload.DaysAfterInitiation as raw String in S3LifecycleConfiguration instead of Integer, and parse them explicitly in a shared parseDays() helper that throws
IllegalArgumentException on a non-integer or out-of-range value. This surfaces as an INVALID_ARGUMENT (HTTP 400) S3 error with a message naming the offending value, instead of silently truncating it.

What is the link to the Apache JIRA

HDDS-16393

How was this patch tested?

Tested using added test-cases.

@priyeshkaratha
priyeshkaratha marked this pull request as ready for review September 21, 2026 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant